SERVER-138949ClosedFixed
Reconstruct the prefix type for collection-origin fields
When we ask for a type of a dotted path defined in the graph, we currently use createDocumentFromLeafMatch. For example, if we have \{$set: {'a.b': '$c'}}, where we know '$c' is a 'number', we nest the 'number' type into the prefix to construct: Root = \{a: array|scalar|{b: array|scalar|number}} This is not pointless, once we have this Root type, we can intersect it with collection schema and $match type inference to potentially remove the prefixes. We need to do the same for fields