Currently there is no way to cover an query with $expr with an index. Even if all dependencies of $expr are provided by the index, we will still generate a FETCH stage to evaluate the $expr.
Currently QuerySolutionNode for IndexScan fully supports having a filter MatchExpression.
We should try to attach $expr to IndexScan nodes instead of generating FETCH, if it is possible.
- depends on
-
SERVER-41252 Enable covered query for $expr with $eq only
-
- In Code Review
-
- related to
-
SERVER-109904 don't FETCH when expr has tight bounds of same type
-
- Backlog
-