ドキュメントを検索し、いくつかのフィールドを変更して更新する私の更新:
newdocument = db.collection.findOne{"id_" : ObjectId("2bfc42346cb2f36c4f3fc6264c")}
newdocument.somefield = "New value"
db.collection.update({"_id" : ObjectId("2bfc42346cb2f36c4f3fc6264c")}, newdocument)
_id
newdocumentからフィールドを削除しない限り、何もしませんdel newdocument["_id"]
。これは予想される動作ですか?