Closed
Description
Oliver Eberle opened DATAMONGO-1457 and commented
As of MongoDB 3.2 $slice
can be used to limit results from group $push
operations.
{ $group: { _id : "$path", count: { $sum : 1 }, data : { $push : { _id:"$_id", name: "$name" } } }},
{ $project : { data : { $slice : ["$data",0,10]}}},
Limit the data array to 10.
Affects: 1.9.1 (Hopper SR1)
Referenced from: pull request #372