Advertisement
Guest User

Untitled

a guest
Nov 19th, 2017
54
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.23 KB | None | 0 0
  1.  
  2. db.restaurants.aggregate([{'$match': {'$and': [{'cuisine': 'American '}, {'address.zipcode': 10311}]}}, {'$unwind': '$grades'}, {'$group': {'_id': '$name', 'score': {'$avg': '$score'}}}, {'$sort': {'score': -1}}, {'$limit': 3}])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement