-
Type: New Feature
-
Resolution: Duplicate
-
Priority: Major - P3
-
None
-
Affects Version/s: None
-
Component/s: Aggregation Framework
-
None
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.
- duplicates
-
SERVER-9377 Allow collecting "top" N values for each group
- Closed