SERVER-138281ClosedDuplicate

getType should not blindly assume FieldPath semantics for all paths

Quoting from [this thread|https://app.graphite.com/github/pr/10gen/mongo/65508#comment-PRRC_kwDOADUBOM8AAAABB5MXRA]: {quote}For example if we have: {$match: \{x: number and not array}} {$project: \{'p.a': '$x'}} Then for unknown 'p' once $project does the reshaping operation, the type of 'p' will be object or array. And the method of traversing 'p.a' (where p might be array) would be unclear. $p.a as an ExpressionFieldPath will produce a number|array, but other logic might not, and

Affected Versions
Versions known to exhibit this issue

No affected versions recorded.

Fixed Versions
Versions that include the fix

No fix available yet.

Components
Server components related to this issue

No components specified.

Labels
Tags and classification

No labels assigned.