Allow group aggregations to limit collected records

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Duplicate
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Aggregation Framework
    • None
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • 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.

            Assignee:
            Carl Champain (Inactive)
            Reporter:
            Developer Easyauto123
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: