Advertisement
Guest User

Untitled

a guest
May 20th, 2015
242
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.29 KB | None | 0 0
  1. works:
  2.  
  3. cursor=db.points.aggregate([{"$group":{"_id": "$created.user", "count":{"$sum":1}}},{"$sort":{"count":-1}}])
  4.  
  5.  
  6. does not work:
  7.  
  8. cursor2=db.points.aggregate([{"$match":{"amenity":{"$exists":1}}}, {"$group":{"_id":"$amenity","count":{"$sum":1}}}, {"$sort":{"count":­1}}, {"$limit":10}])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement