Skip to content

Instantly share code, notes, and snippets.

@asw001
Last active June 22, 2017 00:21
Show Gist options
  • Save asw001/7717eb14ecec8702315685ae49b07be7 to your computer and use it in GitHub Desktop.
Save asw001/7717eb14ecec8702315685ae49b07be7 to your computer and use it in GitHub Desktop.
Unit2 Basic Drills
db.restaurants.find()
db.restaurants.find().limit(10).sort({name: 1})
db.restaurants.findOne({_id: documentId})
db.restaurants.find({borough: 'Queens'})
db.restaurants.find().count()
db.restaurants.remove({_id: ObjectId("AAAAAAAAAAAAAAAAA")})
db.restaurants.update({"_id" : ObjectId("59487d7493a61d80ae81d2ac")}, {params})
db.restaurants.updateMany({"bourough": 'Bronx'}, {"cuisine" : "American"})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment