DDCODE

Share programming skills from Magic Oriental

Update query criteria for mongoDB?

 May 12, 2019   mongodb, question

Xiao Bai asked a question.

db.users.insert({"name": "demo"})

Insert the above ten times.

db.users.update({"name": "demo"}, {$set: {"age": 24}})

In this case, all ten records should be matched, but why only the first one?

https://docs.mongodb.org/getting-started/shell/update/#update-multiple-documents

<< Mongodb > 3.0.0 Import data is extremely slow Location-based array modification in mongodb >>

Powered by MyWiki WordPress Theme