Suppose I have a collection whose documents have this structure
{
...
"ts": [NumberLong("5"), NumberLong("7")]
...
}
where ts is an array of two Long elements, where the second is strictly bigger than the first one.
I want to retrieve all documents where all the elements of the array ts are within a range (bigger than a value but smaller than another).
Suppose the range is between 4 and 9; I am trying this query, but I find unexpected results:
db.segments.find({$nor: [{ "ts": {$gt:9, $lt:4}}]}).toArray()