Why aren't all my documents updated in Firestore?

杀马特。学长 韩版系。学妹 提交于 2019-12-02 11:26:53

You shouldn't mutate the collection as you iterate through it. Instead, fetch the document references and then iterate.

count = 0
documents = [snapshot.reference for snapshot in db.collection('avances').get()]
for document in documents:
    document.update({u'vigente': False})
    count += 1

Reference: https://github.com/GoogleCloudPlatform/google-cloud-python/issues/6033

Update: It appears the Firestore python client does have a 20 second timeout for the generator returned from a query.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!