我需要从远程服务器运行python脚本来维护Firebase数据,我想每24小时删除一次名为“邮件”的集合中的所有文档 google示例显示以下代码:
def delete_collection(coll_ref, batch_size):
docs = coll_ref.limit(10).get()
deleted = 0
for doc in docs:
print(u'Deleting doc {} => {}'.format(doc.id, doc.to_dict()))
doc.reference.delete()
deleted = deleted + 1
if deleted >= batch_size:
return delete_collection(coll_ref, batch_size)
但是我不知道如何执行此操作以进行日常删除,有人可以告诉我如何执行此操作吗?
非常感谢