-
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
Similar to matcher::narrowPath (SERVER-134593, SERVER-135339, SERVER-134936), but for aggregation pipelines!
It should accept the PathSemantics defined in SERVER-135978.
Type narrowPath(Type inputType, FieldPath path, PathSemantics semantics, Type constraint, bool assumeTrue);
And will produce a Type derived from inputType which is narrowed by the constraint type.
We will only implement PathSemantics::kFieldPath, but we should support dotted paths!
Examples:
- {a: any, b: any}
with path 'a' with constraint number produces {a: number, b: any}
- {a: any, b: any}
with path 'a.b' with constraint number produces {a:
{b: number}, b: any}
-
- This is similar to {$expr: {$isNumber: '$a.b'}} for example which implies 'a' is non-array since the result is number.
- Or {$expr: {$eq: ['$a.b', 1]}} which also implies non-array, but the type returned here should be {a: {b: number(S)}} (only subset of numbers).
- depends on
-
SERVER-135978 Implement expression::traversePath
-
- Needs Scheduling
-
- is related to
-
SERVER-134936 Implement matcher::narrowPath for dotted paths
-
- In Code Review
-
-
SERVER-135339 Implement matcher narrowing with LeafArrayBehavior::kNoTraverse
-
- In Code Review
-
-
SERVER-134593 Add basic matcher path traversal and narrowing
-
- Needs Scheduling
-