参考:https://stackoverflow.com/questions/23334743/setting-justone-limiter-for-pymongo-remove-throws-typeerror

 

正确的写法:

collection.remove({"_id":earliest_id_date["_id"]})

ufo.users.remove({'emails.address': 'foo@bar.com'}, safe=True)

 

 

下面这个写法会报错:

collection.remove({"_id":earliest_id_date["_id"]}, 1)

后面不能写1,会报错raise TypeError("Wrong type for %s, value must be a boolean" % (option,))

相关文章:

  • 2022-01-19
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2021-11-29
  • 2021-09-07
猜你喜欢
  • 2022-02-18
  • 2022-01-11
  • 2021-06-09
  • 2021-07-27
  • 2021-09-15
  • 2022-12-23
  • 2021-06-22
相关资源
相似解决方案