Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-43928

Allow group aggregations to limit collected records

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      None

      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.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              carl.champain Carl Champain (Inactive)
              Reporter:
              dev@easyauto123.com.au Developer Easyauto123
              Participants:
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: