开发者

How do you update a Mongodb document? [closed]

开发者 https://www.devze.com 2023-01-24 18:50 出处:网络
Closed. This question needs to be more focused. It is not currently accepting answers. Want to improve this question? Update the question so it focuses on one problem only by editing this
Closed. This question needs to be more focused. It is not currently accepting answers.

Want to improve this question? Update the question so it focuses on one problem only by editing this post.

开发者_如何学Python

Closed 8 years ago.

Improve this question
  • Add an element to it
  • Update a value of an element


http://www.mongodb.org/display/DOCS/Updating


It all depends which program language you are using. If you are using Mongo shell, you can just do

db.user.save({username:"tom"});

Update will be similar concept,

db.users.update({b:'q'}, {$set:{a:1}}, false, true) If you are familiar with SQL script, check this out

http://www.mongodb.org/display/DOCS/SQL+to+Mongo+Mapping+Chart

0

精彩评论

暂无评论...
验证码 换一张
取 消