-
Type: New Feature
-
Resolution: Duplicate
-
Priority: Minor - P4
-
None
-
Affects Version/s: 2.4.8
-
Component/s: Aggregation Framework
-
None
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:[
Unable to find source-code formatter for language: "mex", ppl_m: 20. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
,
Unable to find source-code formatter for language: "pue", ppl_m: 5. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
, ...
]},...
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
- duplicates
-
SERVER-6074 Allow $slice operator in $project
- Closed