|
Unassigning and moving to backlog. Resolving this ticket is difficult until agg's dependency tracking is more thorough.
As initially proposed, a pipeline of the form:
DocSourceCursor with project (a: 1, b: 1) ----> (other stages) -----> $project (a: 1, b: 1)
Should have had the second $project removed, provided that (other stages) didn't include any stages with EXHAUSTIVE_FIELDS dependencies ($group or $project). Similarly, if the last $project on the shard pipe was identical to a project on the merge pipe, it seemed that the one on the merge pipe could be safely removed. However, due to $lookup/other stages, this is difficult:
DocSourceCursor (a:1, b:1) --> $lookup (results inserted into c) ---> $project (a:1, b:1)
In this case, the second project cannot be safely removed, because an additional field has been created due to $lookup, but we have no way of identifying that this has happened with our current dependency tracking.
|