I have a bunch of documents that look like this
{
"coordinates": [[1, 2], [nan, nan] ]
}
I would like to filter and find all documents where one of those arrays contains nan
values like in the example.
I have a bunch of documents that look like this
{
"coordinates": [[1, 2], [nan, nan] ]
}
I would like to filter and find all documents where one of those arrays contains nan
values like in the example.
$elemMatch with $in
query will also filter, check below query
db.collection.find({"coordinates":{"$elemMatch":{"$elemMatch":{"$in":["nan"]}}}})
If you always have pairs in your inner arrays then
db.yourColl.find({coordinates: [NaN, NaN]})
should do the job