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

Allow $slice operator in aggregation pipeline

    XMLWordPrintable

    Details

    • Type: New Feature
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Duplicate
    • Affects Version/s: 2.4.8
    • Fix Version/s: None
    • Component/s: Aggregation Framework
    • Labels:
      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

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: