I would like to find documents with a mango query by specifying the minimal and maximal size of an array property. Given a document with an array property customers
. I'd like to be able to find all documents with the number of customers between 10 and 20.
Something like
mango_query = {
"doc.customers": {"$size": {"gte": 10}},
"doc.customers": {"$size": {"lte": 20}}
}
The response to a request like that is
Bad argument for operator $size: {[{<<36,108,116,101>>,10}]}')
So how should I write a mango filter on the size of an array?
Checking the code here, only integer argument is supported for $size operator. So it can't be combined with other operators. It supports only $size exact matches.
And when matching
length(Values) == Arg
Only exact match is supported