Details
-
Bug
-
Status: Closed
-
Major - P3
-
Resolution: Duplicate
-
2.6.0
-
None
-
None
-
Query
-
ALL
Description
Queries of the form {"a.0.b": null} incorrectly match documents where "a" is an array such that the first element is a subdocument with a non-null value for "b".
Regression since 2.4. Affects 2.6.0 through 2.6.4.
Example repro:
> db.version()
|
2.6.4
|
> db.test.drop()
|
true
|
> db.test.insert({a:[{b:1}]})
|
> db.test.find({"a.0.b":null}) // incorrect: document should not be returned |
{ "_id" : ObjectId("53eab15e36fe6f6cc7dd5e68"), "a" : [ { "b" : 1 } ] } |
> db.test.ensureIndex({"a.0.b":1}) |
> db.test.find({"a.0.b":null}) // correct: document not returned (matcher bypassed) |
>
|
Attachments
Issue Links
- duplicates
-
SERVER-27442 Positional path component in match language should not act as both an array index and a field name for a single document
-
- Backlog
-
- is duplicated by
-
SERVER-39884 Query for null on a field in embedded documents using array index does not work as expected
-
- Closed
-
- related to
-
SERVER-27442 Positional path component in match language should not act as both an array index and a field name for a single document
-
- Backlog
-
-
SERVER-14874 Querying on {$ne:null} on embedded documents within arrays inconsistent between 2.4 and 2.6
-
- Closed
-