SERVER-139315Needs Scheduling
Record types of computed fields
We currently do not type computed fields like: {$set: \{a: {$add: [...]}} {$set: \{a: {$toLower: "$b"}} etc. Suggested solution The general practice in the dependency graph has been to compute the metadata of fields when we process the stage declaring the field, and to do additional type narrowing, using applicable $match stages, between the declaration site and the call site. I think we can continue that pattern. We already process per-expression dependencies at [processExpressio