[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:
Duplicate
duplicates SERVER-9377 Allow collecting "top" N values for e... Closed
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 ]

Hi dev@easyauto123.com.au,

Thanks for the report.
This issue is already tracked in SERVER-9377; you can watch it for updates.
Therefore, I am closing this ticket as a duplicate of SERVER-9377. If you believe it is not a duplicate, please let us know why and we will reopen it.

Kind regards,
Carl

Generated at Thu Feb 08 05:04:29 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.