Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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