Details
-
Bug
-
Resolution: Duplicate
-
Major - P3
-
None
-
None
-
None
-
Query
-
ALL
Description
Example involves index on array of key/value structures.
db.foo.drop();
|
db.foo.insert({"a":[ {"k":"x", "v":"y"}, {"k":"z", "v":1} ] })
|
db.foo.createIndex({"a.k":1, "a.v":1},{partialFilterExpression:{"a.k":{$exists:true}}})
|
db.foo.explain().find({"a":{$elemMatch:{"k":"x","v":"y"}}})
|
// results in collection scan
|
db.foo.explain().find({"a":{$elemMatch:{"k":"x","v":"y"}},"a.k":"x"})
|
// does use partial index as expected, but the redundant condition should not be necessary
|
Attachments
Issue Links
- duplicates
-
SERVER-32540 Make partial index subset analysis consider $elemMatch object a subset of $exists
-
- Backlog
-