자주쓰는 MongoDB 명령어
# remove a document on MongoDB $ db.<collection>.remove({ _id: ObjectId("id")}); # update a document on MongoDB # change name to "bao" $ db.<collection>.update({ _id: ObjectId("") }, { $set: { name: "bao" }}); # update multi documents on MongoDB # find all documents which type is not "t" and then change their type to "n" $ db.<collection>.update({ type: { $ne: 't' }}, { $set: { type : ''n" }}, { multi: true });
댓글
댓글 쓰기