Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- db.inspections.aggregate([
- {$match:
- {"VIOLATION CODE":"04L"}
- },
- {$out: "rests_with_mice"}
- ])
- db.demographics.aggregate([
- {$match:
- {"PERCENT FEMALE":"0.5"}
- },
- {$out: "zips_with_split_gender"}
- ])
- db.restaurants.aggregate([
- {$lookup:
- {
- from: "demographics",
- localField: "address.zipcode",
- foreignField: "JURISDICTION NAME",
- as: "sub_zipcode"
- }
- },
- {$match:
- {"sub_zipcode.PERCENT FEMALE": {$eq: "0.5"}}
- },
- {$lookup:
- {
- from: "rests_with_mice",
- localField: "name",
- foreignField: "NAME",
- as: "sub_rests_with_mice"
- }
- },
- {$project:
- {"_id":0, "borough":1, "name":1, restaurant_id":1}
- },
- {$sort:
- {"_id":0, "borough":1, "name":1}
- }
- {$out: "please work"}
- ])
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement