Python Pymongo删除多个类型错误
我一直使用此选项删除超过24小时的条目:Python Pymongo删除多个类型错误,python,mongodb,pymongo,typeerror,Python,Mongodb,Pymongo,Typeerror,我一直使用此选项删除超过24小时的条目: entries.delete_many({"Time": {"$lt": time.time()-24*60*60} }) 它已经工作了很长时间,但现在它突然抛出了一个错误: Type: TypeError (Inappropriate argument type.) 是被弃用了还是怎么了?它是如何工作的?我不知道为什么它会停止工作,但您应该尝试传递一个datetime对象,而不是int datetime.datetime.now()-datetim
entries.delete_many({"Time": {"$lt": time.time()-24*60*60} })
它已经工作了很长时间,但现在它突然抛出了一个错误:
Type: TypeError (Inappropriate argument type.)
是被弃用了还是怎么了?它是如何工作的?我不知道为什么它会停止工作,但您应该尝试传递一个datetime对象,而不是int
datetime.datetime.now()-datetime.timedelta(24,60,60)