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

Allow $slice operator in aggregation pipeline

    XMLWordPrintableJSON

Details

    • Icon: New Feature New Feature
    • Resolution: Duplicate
    • Icon: Minor - P4 Minor - P4
    • None
    • 2.4.8
    • Aggregation Framework
    • None

    Description

      I'm trying to get the top (and bottom) N cities, sorted by population and grouped by year.

      After some $sorts's, $group's and $push's, I've got something like this:

      {_id: "2013",
      cities:[

       

      ,

       

      , ...
      ]},...

      Now, I want to do perform {$project: {cities: {$slice: N}}}

      I think the $project operator should accept all of the operators the projection document does in the find() command

      Attachments

        Activity

          People

            Unassigned Unassigned
            antonimmo Antonio Quintana
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: