[SERVER-56832] Provide aggregation stage to abort pipeline halfway through Created: 11/May/21 Updated: 12/May/21 Resolved: 12/May/21 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | 4.4.6 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Erikvc Erik | Assignee: | Edwin Zhou |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
We have some slow large aggregation pipelines where a $limit at the end is not sufficient to prevent slow queries, and where a $limit early in the pipeline would give incorrect results. Hence we want to have a way to limit early but abort the query instantly if this limit is hit: For example:
I think limit is our main use case but one could also imagine other uses where a more dynamic condition is useful.
|
| Comments |
| Comment by Edwin Zhou [ 12/May/21 ] |
|
Hi sflkjdsflksdmfslkdfj@mailinator.com, Thank you for your report and your clear example. I believe this improvement duplicates SERVER-40117 and will close this ticket. SERVER-40117 describes a new $exit operator that will interrupt the pipeline when certain given conditions are met. Best, |