-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
While the dependency graph normally makes no attempt to do anything intelligent when it encounters an array, for getConstant(), we could do the same thing that FieldPathExpression does, i.e. project into [[]] if we traverse constant arrays.
Example:
$set: {a: [
{b: 1}, {b: 2}]}
If we query what is $a.b we could say it is [1, 2].
So if you had a $match after that said
{$match: {'a.b': 3}}
We could actually look at the constant value and then the match and determine it is always false.