MongoDB: How to update multiple documents with a single command?



MongoDB: How to update multiple documents with a single command?
Ans : For versions of mongodb 3.2+ you can use method updateMany() to update multiple documents
db.documentName.updateMany({"conditionFiledName":"value"}, {$set: {fieldName1: value1,fieldName2: value2}})

Comments

Popular posts from this blog

Install canon LBP2900 driver in linux

python subprocess become idle after a while

show preview of pdf file saved in gridfs on browser