Advertisement
ridjis

mongo

Mar 9th, 2016
309
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 1.05 KB | None | 0 0
  1. //db.recepies.find({required_time: {$lt: 25}})
  2. //db.recepies.find({name: "Glass of water"})
  3. //db.recepies.find({name: {$in: ["Pizza dough", "Pancakes"]}})
  4. //db.recepies.find({required_time: {$gte: 20, $lte: 30}})
  5. //db.recepies.find({complexity: {$nin: [3,2,1]}})
  6. //db.recepies.find({grades: {$all: [10,10,10,10]}})
  7. //db.recepies.find({$and: [{grades: 3}, {grades: 4}, {grades: 5}, {grades: 6}]})
  8. //db.recepies.find({"ingrediends.quanity": {$exists: true, $nin:[5,15]}})
  9. //db.recepies.find({$or: [{"author.name": "Stefan"}, {"author.name": "Lidija"}]})
  10. //db.recepies.find({grades: 10})
  11. db.recepies.find(ingredients: {$elemMatch: {name: ""}})
  12.  
  13.  
  14. //db.movies.find({"cast.name": "Leonardo DiCaprio"})
  15. //db.movies.find({$and: [{genre: "Action"}, {year: {$gte: 2000, $lte: 2010}}]})
  16. //db.movies.find({director: {$ne: "Christopher Nolan"}}, {title: 1})
  17. //db.movies.update({_id: ObjectId("56dff4ed81ff8ec80e2c3295")}, {$set : {budget: 1000000}})
  18. //db.movies.find({_id: ObjectId("56dff4ed81ff8ec80e2c3295")})
  19. //db.movies.find({},{title: 1}).sort({budget: -1}).limit(10)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement