Last active
January 11, 2018 13:51
-
-
Save kevinchisholm/11b3721d41311f7b7caadfb5c1bed86a to your computer and use it in GitHub Desktop.
This file contains 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
//create the madmen collection | |
db.createCollection('madmen'); |
This file contains 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
//insert five documents in the "madmen collection | |
db.madmen.insert({'name' : 'Don Draper'}); | |
db.madmen.insert({'name' : 'Roger Sterling'}); | |
db.madmen.insert({'name' : 'Bert Cooper Sterling'}); | |
db.madmen.insert({'name' : 'Peter Campbell'}); | |
db.madmen.insert({'name' : 'Joan Harris'}); | |
This file contains 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
//show all of the databases | |
show dbs | |
This file contains 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
db.madmen.update( | |
{ "_id" : ObjectId("XXXX") }, | |
{ $set: { "name": "Pete Campbell Jr." } } | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment