SHARE
TWEET

Untitled

a guest Jan 27th, 2020 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //Customers Info
  2. db.customers.insert({ name: "David Gamez", address: "3 Example Road, London", telephone_num: 1234, email: "david@exmpl.com" })
  3. db.customers.insert({ name: "Sarah Jones", address: "6 Pretty Lane, Cardiff", telephone_num: 3333, email: "sarah@exmpl.com" })
  4. db.customers.insert({ name: "Alice Smith", address: "42 Narrow Close, London", telephone_num: 4545, email: "alice@exmpl.com" })
  5. db.customers.insert({ name: "Tony Strong", address: "88 Example Avenue, London", telephone_num: 7777, email: "tony@exmpl.com" })
  6.  
  7. //Product info
  8. db.products.insert({ name: "Sony SmartWatch 3", features: "OS: watchOS 3 | Compatibility: iOS | Display: 1.53\" OLED | Processor: S2 dual-core  Band sizes: Varies drastically per watch size | Onboard storage: 8GB (only 2GB and 75MB allowed for music and photos, respectively) | Battery: 18 hours | Charging method: Wireless | IP rating: IPX7 | Connectivity: Wi-Fi, Bluetooth, NFC", price: 368, stock_count: 6 })
  9. db.products.insert({ name: "Apple Watch", features: "OS: Android Wear | Compatibility: Android | Display: 1.6\" LCD | Processor: Quad-core 1.2GHz | Case dimensions: 36mm diameter, 10mm thick | Onboard storage: 4GB | Battery: 2 days | Charging method: via microUSB | IP rating: IP68 | Connectivity: Wi-Fi, Bluetooth, NFC, GPS", price: 79.99, stock_count: 0 })
  10. db.products.insert({ name: "Moto 360 (2nd Gen)", features: "OS: Android Wear | Compatibility: Android, iOS | Display: 1.37\" or 1.56\" LCD | Processor: Quad-core 1.2GHz | Case dimensions: 42mm or 46mm diameter, each 11.4mm thick | Onboard storage: 4GB | Battery: 1.5-2 days depending on size | Charging method: Wireless | IP rating: IP67 | Connectivity: Wi-Fi, Bluetooth", price: 149.95, stock_count: 55 })
  11. db.products.insert({ name: "Asus ZenWatch 3", features: "OS: Android Wear | Compatibility: Android, iOS | Display: 1.39\" 400 x 400 AMOLED | Processor: Snapdragon Wear 2100 | Case dimensions: 44mm diameter, 9.9mm thick | Onboard storage: 4GB | Battery: 2 days | Charging method: via proprietary USB charger | IP rating: IP67 | Connectivity: Wi-Fi, Bluetooth", price: 269, stock_count: 107 })
  12.  
  13. //Finding and Updating Customers info
  14. db.customers.find({"name": "David Gamez"}).pretty()
  15.  
  16. db.customers.update({"name":"David Gamez"} , {$set:{"address":"3 Long Avenue, Glasgow"}})
  17.  
  18. db.customers.find({"name":"David Gamez"}).pretty()
  19. {
  20.         "_id" : ObjectId("5e2eaf0568ea4917def1dd7b"),
  21.         "name" : "David Gamez",
  22.         "address" : "3 Example Road, London",
  23.         "telephone_num" : 1234,
  24.         "email" : "david@exmpl.com"
  25. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top