Looks likeĀ SERVER-78260 completely disabled the use of index scans for queries of the form {$elemMatch: {$not: ...}}, regardless of whether or not they participated in the "contained $or pushdown" rewrite.
In principle, for a filter like {a: {$elemMatch: {b: {$not: {$eq: 1}}}, we should be able to use the index bounds [MinKey, 1) (1, MaxKey] on index field a.b, then filter out documents using the $elemMatch predicate. We should restore this behaviour outside of the contained $or case described in SERVER-78260.
- is related to
-
SERVER-78260 Contained $or rewrite optimization incorrectly lifts a negation predicate outside an $elemMatch leading to missing query results
-
- Closed
-
- related to
-
SERVER-125775 Implement a PBT for elemMatch object traversal
-
- Needs Scheduling
-
-
SERVER-125857 Allow $or allow pushdown when source and destination are inside the same $elemMatch
-
- Needs Scheduling
-