Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试collection使用mongodb不同的字段值更新大量文档。我Id对每个document. 我需要在单个更新命令中更新大量记录。我们如何更新大量文档。请提出解决此问题的方法。
collection
mongodb
Id
document
您可以使用以下命令更新多条记录,
db.getCollection('collectionName').update({'condition if any'},{$set: { field:value}}, {multi:true})