[SERVER-43928] Allow group aggregations to limit collected records Created: 10/Oct/19 Updated: 10/Oct/19 Resolved: 10/Oct/19 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Aggregation Framework |
| Affects Version/s: | None |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Major - P3 |
| Reporter: | Developer Easyauto123 | Assignee: | Carl Champain (Inactive) |
| Resolution: | Duplicate | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Participants: | |||||||||
| Description |
|
Consider this: { $group: { _id: "$SomeField", items: { $push: "$_id" }} } The aggregation above allows to return all ids grouped but what if you are only interested in the first 10 ids?
It would be nice if $push would allow a limit so that only a certain number is returned.
I often have to write queries to return oldest 10 records grouped by some criteria and it is almost impossible to do in mongodb at the moment. |
| Comments |
| Comment by Carl Champain (Inactive) [ 10/Oct/19 ] |
|
Thanks for the report. Kind regards, |