Created
April 15, 2017 17:53
-
-
Save NickFoden/7b5c0b2c16666a538de7a312f3c56dca to your computer and use it in GitHub Desktop.
Solutions to Mongo Basics
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var myRestaurant = { | |
... address: {}, | |
... borough: "Queens", | |
... cuisine: "Colombian", | |
... grades: [], | |
... name: "Seba Seba", | |
... restaurant_id: "373737373737373737" | |
... } | |
> db.restaurants.insertOne(myRestaurant); | |
db.restaurants.find().limit(5).pretty(); | |
db.restaurants.find({"address.zipcode":"11206"}).count(); | |
db.restaurants.findOne({}); | |
db.restaurants.remove({"_id":ObjectId("58f24a3367dc631df66420de")}); | |
db.restaurants.find({"address.zipcode":"10035"}).count(); | |
db.restaurants.updateMany({"address.zipcode":"10035"}, {$set: {"address.zipcode":"10036"}}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment