0
检索到的原始数据有存储在mongodb
一些数据和检索到的变量与student
student = coll.find_one({"name":"Cammy"})
:龙卷风 - 更换从MongoDB的
{ "_id" : ObjectId("511367bebb8027582a953cce"), "name" : "Cammy", "desc" : "does well in Math" }
我想改变和student
一些属性执行:student['desc'] = "does well in Physics"
。为了替换原始文件,我使用了coll.save(student)
。但不是替换,而是出现了与name
和desc
相同的新记录,但出现了不同的_id
。 我应该如何替换原始文档?
你能投票答案 – user1447121 2013-02-25 23:55:34