-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Querying
-
None
-
Environment:Ubuntu 16.04.6 with MongoDB 4.0.9
MongoDB Atlas with MongoDB 4.0.10
-
ALL
-
If you have in your collection a document:
{ _id: ..., prices : [ { max : 250, min : 200 } ] }
You can successfully query it by using the following filters:
1)
{'prices.0.min' : 200 }
2)
{'prices.0.min' : { $exists : true } }
3)
{ 'prices.0.min' : { $gt : 100 } }
4)
{ 'prices.0.min' : { $exists : true, $ne : 123 } }
BUT you CANNOT do it using the below filters:
1)
{ 'prices.0.min' : { $exists : true, $ne : null } }
2)
{ 'prices.0.min' : { $ne : null } }
The problem noted is with only `$ne : null` in filter.
- duplicates
-
SERVER-36681 Change {$ne: null} semantics to be more intuitive
- Backlog