Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. where the restaurant is not listed in the inspection data set.
- db.restaurants.aggregate([
- {$lookup:
- {
- from: "inspections",
- localField: "",
- foriegnField: "",
- as: "restaurants_with_inspections"
- }
- },
- {$match:
- {"borough":"Manhattan","address.street":"Madison Avenue"}
- },
- {$sort:
- {"name":1}
- },
- {$project:
- {"_id":0, "restaurant_id":1, "name":1, "address.street":1}
- }
- ]).pretty()
- 2. for restaurants with evidence of mice or live mice (use violation code = ā04Lā)
- in zipcodes that have a fifty-fifty split by gender (use percent female = ā0.5ā).
- db.restaurants.aggregate([
- {$sort:
- {"borough":1, "name":1}
- },
- {$project:
- {"_id":0, "borough":1, "name":1, "restaurant_id":1}
- }
- ]).pretty()
- 3. write our own data demand/query
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement