MongoDB version: 9.0.0 (Atlas, queryFramework: sbe/classic both observed), also reproduced on 8.0.29
Summary: A predicate that would make a partial index eligible when written as a plain field: value match is silently excluded from the candidate index set when the same predicate is wrapped in $expr — even though $expr predicates otherwise generate normal index bounds (via $_internalExprEq) and get used against non-partial indexes without issue.
Question for support: Is this intentional/documented behavior (partial-index subsumption checking is syntactic and only inspects the plain MatchExpression tree, not $expr), or a planner gap? If intentional, request it be called out explicitly in the partial index docs — we only found it via explain comparison, not documentation.
- is related to
-
SERVER-38799 $expr does not use sparse or partial indexes
-
- Backlog
-