-
Type: Task
-
Resolution: Unresolved
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Labels:None
-
Query Optimization
The $unionWith stage currently reports that it requires the whole document in order to maintain consistency between each branch of the union operation. Conceptually, we could do better (and potentially get a covered plan) if the union stage acted like more of a passthrough case and allowed an inclusion projection of referenced fields to be pushed down to the query system. However, if we were to allow this, it would also be desirable to push this subset of fields to the inner pipeline of the union.