Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
ここに私のコードがあります:
temp = haha.find_one({"fname" : name }) haha.update({"fname" : name } , {"time" : now()})
その後、レコード「temp」がデータベースに消えてしまい、本当に混乱しました...
多くの人が犯す古典的な間違い:)、ドキュメントを で置き換えました。{"time" : now()}使用する必要があります$set:
{"time" : now()}
$set
haha.update({"fname" : name } , {"$set":{"time" : now()}})