[SERVER-13400] Allow $slice operator in aggregation pipeline Created: 28/Mar/14  Updated: 15/Apr/14  Resolved: 28/Mar/14

Status: Closed
Project: Core Server
Component/s: Aggregation Framework
Affects Version/s: 2.4.8
Fix Version/s: None

Type: New Feature Priority: Minor - P4
Reporter: Antonio Quintana Assignee: Unassigned
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
duplicates SERVER-6074 Allow $slice operator in $project Closed
Participants:

 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



 Comments   
Comment by Antonio Quintana [ 15/Apr/14 ]

1. Sorry, I didn't find it although I looked for it before posting this
2. Please update the "Affects version/s" field in https://jira.mongodb.org/browse/SERVER-6074 because it still happens in 2.4.8 and 2.4.10

Comment by Scott Hernandez (Inactive) [ 28/Mar/14 ]

dup of SERVER-6074

Generated at Thu Feb 08 03:31:36 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.