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

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix
9.1.0-rc09.1.0-rc1025
Components
Server components related to this issue

No components specified.

Labels
Tags and classification

No labels assigned.