-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Execution
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
Consider the following pipeline:
[{$lookup: { from: "foreign", let: {maxValue: "$maxValue"}, pipeline: [{$match: { $expr: {$lte: ["$values", "$$maxValue"]} }}], as: "output" }}]
Because of $lookup, we are forced to use $expr to be able to reference maxValue, which is dependent on current document.
However, it will use $lte from aggregation expressions, not from match expressions.
This is important if we want an array lookup (e.g. match all documents where values array contains at least one element less than or equal to $$maxValue).
Even if we implement correct semantics via $filter, we won't be able to use multi-key index on values.
- is related to
-
SERVER-98704 $match with an array and the use of a function fails to match
-
- Closed
-