📜  mongodb 更新 - 任何代码示例

📅  最后修改于: 2022-03-11 14:55:34.643000             🧑  作者: Mango

代码示例3
db.collectionName.update({"aField":"vale1"},{$set:{"anotherField":"value2"}})

-search for documentations for more examples than search
-aField is used to find the documents
-anotherField is the field that will be updated
-You can also use the below:
-- updateOne
-- findOneAndUpdate