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