-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
None
-
Query Optimization
-
None
-
None
-
None
-
None
-
None
-
None
-
None
We have a few divergent code paths which are used to determine if a field in question is array.
The public canPathBeArray method on the graph is the most complete implementation. But internally, when building the graph, we use different more limited checks.
For example, in a rename {$set: {a: '$b.c'}}, if 'b.c' is a constant, we will not apply the walkConstant logic if 'b' has a constant value. Whereas if we query "b.c" using the public API we will.
After we unify the code, the following pipeline should allow the rename 'a' to use the inferred arrayness from the $match.
[\{$match: {b: {$not: {$type: 'array'}}}, \{$set: {a: '$b'}}]
This might also resolve SERVER-134117, so please close it when this ticket is complete.
- is related to
-
SERVER-134117 Preserve path arrayness in more cases when only prefix is matched
-
- Backlog
-
- related to
-
SERVER-136156 Benchmark the cost of graph building and type inference
-
- Needs Scheduling
-