【python】mongo删除数据
正确的写法:
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,))