1 Update Document
grammar structure
db.集合名称.update(条件,修改后的数据)
Modify _id record 1, point number like 1000, enter the following statement:
After performing found this document in addition to other fields thumbup field are gone.
To solve this problem, we need to use modifiers $ set to achieve the following command:
db.comment.update({_id:"2"},{$set:{thumbup:2000}})
2 Delete Document
grammar structure
db.集合名称.remove(条件)
The following statement will delete all the data, caution ~
db.comment.remove({})
Delete conditions can be placed in braces, such as deleting data thumbup 1000, enter the following statement:
db.comment.remove({thumbup:1000})