I\'m try get data from collection with some order:
db.data.aggregate([ {$limit: 1000}, {$group: { _id: \"$service\", count: {$sum: 1}
So per the comment you need a MongoDB version 2.6 do do this. But of course using 2.6 this works for me:
db.collection.aggregate([ { "$limit": 1000 }, { "$group": { "_id": null, "count": { "$sum": 1}, "data": { "$push": "$$ROOT" } }} ])