aldinokemal

MongoDB - Select

Mar 27th, 2022 (edited)
372
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // select *  from customers where _id = 'ak'
  2. db.customers.find({
  3.     _id: "ak"
  4. });
  5.  
  6. // select * from customers where name = 'Aldino Kemal'
  7. db.customers.find({
  8.     name: "Aldino Kemal"
  9. });
  10.  
  11. // select * from products where price = 2000
  12. db.products.find({
  13.     price: 2000
  14. });
  15.  
  16. // select * from orders where items.product_id = 1
  17. db.orders.find({
  18.     "items.product_id": 1
  19. });
Advertisement
Add Comment
Please, Sign In to add comment