-
Type: Bug
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: 3.2.16
-
Component/s: Querying
-
None
-
ALL
-
Assume the collection name "groups"
Sample Document:
{ "_id" : ObjectId("597620fcba76f211586c9203"), "task" : { "taskId" : ObjectId("597620fcba76f211586c9402"), "hasTasks" : true } }
Failing Query:
db.getCollection('groups').find({task: { hasTasks: true, taskId: ObjectId("597620fcba76f211586c9402")}, _id: ObjectId("597620fcba76f211586c9203") })
Passing Query:
db.getCollection('groups').find({task: { taskId: ObjectId("597620fcba76f211586c9402"), hasTasks: true, }, _id: ObjectId("597620fcba76f211586c9203") })
As you can see, if the order of the query fields in the sub-document (viz. task) does not match the order in which it exists in the document, query does not return any results.
- duplicates
-
SERVER-5030 Document equality should be independent of field insertion order
- Backlog