Advertisement
Guest User

Untitled

a guest
Nov 14th, 2017
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. db.inventory.insertMany([
  2. {tags:"red",quantity:4},
  3. {tags:"blue",quantity:4},
  4. {tags:"red",quantity:3}
  5.  
  6. ]);
  7.  
  8. db.inventory.find({
  9. $and:[
  10. {destination : { $exists: false }},
  11. {items:
  12. { $and:
  13. [
  14. $or:[
  15. {tags : "red"},
  16. {tags : "blank"}
  17. ],
  18. {quantity: { $mod: [ 4, 0 ] }}
  19. ]
  20. }
  21. }
  22.  
  23. ], { _id: 0, name: 1}
  24. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement