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()}})