-
Type: Bug
-
Resolution: Unresolved
-
Priority: Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Query Language
-
None
-
Query Optimization
-
ALL
-
(copied to CRM)
> db.foo.find({'x.': 1}) { "_id" : ObjectId("6061e7ac7cc9a947848c1015"), "x" : [ 1 ], "y" : [ { "" : 1 } ] } { "_id" : ObjectId("6061e7f27cc9a947848c1016"), "x" : { "" : [ 1 ] }, "y" : [ { "" : 1 } ] } > db.foo.find({'y.': 1}) >
If we aren't going to error when there is an empty path component, the results should at least make sense. I can't think of any reason (modulo bugs of course) why the first document would match {'x.': 1}. And the second document should either match both or neither of {'x.': 1} and {'y.': 1}. The current behavior where it matches one but not the other is odd.