[SERVER-73547] Allow collection-agnostic aggregation within $unionWith Created: 02/Feb/23 Updated: 03/Feb/23 Resolved: 02/Feb/23 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Davis Haupt (Inactive) | Assignee: | Backlog - Query Optimization |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Assigned Teams: |
Query Optimization
|
||||||||
| Participants: | |||||||||
| Description |
|
Collection-agnostic aggregations that get their documents from a document-generating stage like $documents are sent to the server with aggregate: 1. There is currently no way to do this for a pipeline within a $unionWith stage, which will fail with a parse error if the specified collection is 1.
This ticket should enable pipelines like:
|
| Comments |
| Comment by Davis Haupt (Inactive) [ 02/Feb/23 ] | |||||||||||||||
|
The way to accomplish this is to simply leave off the coll parameter:
|