Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db.restaurants.aggregate([
- {$lookup:
- {
- from: "demographics",
- localField: "address.zipcode",
- foreignField: "JURISDICTION NAME",
- as: "sub_zipcode"
- }
- },
- {
- $unwind : "$sub_zipcode"
- },
- {$match:
- {"sub_zipcode.PERCENT FEMALE": {$eq: "0.5"}}
- },
- {$lookup:
- {
- from: "inspections",
- localField: "name",
- foreignField: "NAME",
- as: "sub_inspections"
- }
- },
- {
- $unwind : "$sub_inspections"
- },
- {$match:
- {"sub_inspections.VIOLATION CODE": {$eq: "04L"}}
- }
- ]).pretty()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement