The "update" command only updates the first matching entry by default. To update all entries, there is a third parameter i.e. "options" where you need to set "multi: true" e.g.
db.coll.update({},{$set:{"attr":”value”]}},{multi:true})
|
Reference:
https://docs.mongodb.org/v2.4/reference/method/db.collection.update/
No comments:
Post a Comment