当前位置: 动力学知识库 > 问答 > 编程问答 >

database - How do you update a Mongodb document?

问题描述:

  • 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

分享给朋友:
您可能感兴趣的文章:
随机阅读: