Created
November 19, 2017 18:11
-
-
Save Bizunow/c8ec68e14f917a75d2baafd2979c7585 to your computer and use it in GitHub Desktop.
[MongoDB] #mongo
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
// MongoDB drop index | |
db.users.dropIndex("cid_1"); | |
// MongoDB create index | |
db.users.createIndex({"name" : 1}, {"unique" : true}) | |
// MongoDB update upsert | |
db.people.update( | |
{ name: "Andy" }, | |
{ | |
name: "Andy", | |
rating: 1, | |
score: 1 | |
}, | |
{ upsert: true } | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment