相关疑难解决方法(0)

如何使用 Python 在 Firestore 中下载大型集合而不会出现 503 错误?

尝试使用 python 计算 firestore 集合中的文档数量。当我使用时db.collection('xxxx").stream(),出现以下错误:

 503 The datastore operation timed out, or the data was temporarily unavailable.
Run Code Online (Sandbox Code Playgroud)

大约进行到一半。它工作正常。这是代码:

    docs = db.collection(u'theDatabase').stream()
    count = 0
    for doc in docs:
        count += 1
    print (count)
Run Code Online (Sandbox Code Playgroud)

每次我在大约 73,000 条记录中收到 503 错误时。有谁知道如何克服 20 秒超时?

python google-cloud-firestore

5
推荐指数
2
解决办法
2938
查看次数

标签 统计

google-cloud-firestore ×1

python ×1