Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- { "_id" : "G", "name" : "Galway", "pop" : 258058 }
- { "_id" : 3, "car" : { "reg" : "142-G-28", "engineSize" : 1 }, "addresses" : [ "MO", "G", "WH" ] }
- db.docs.aggregate([{
- $project:
- {item: 1,
- pop:{
- $cond: { if: { $gte: [ '$pop', 100000 ] }, then: 'Big county', else: 'Small county'}}}}])
- db.docs.find({"pop":{$gte:100000}})
- db.docs.find({"pop":{$gte:100000}},{"_id":0, "name":1})
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement