How do you update a Mongodb document? [closed]
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
开发者_如何学PythonClosed 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
精彩评论