简体   繁体   English

FirebaseError:数据存储操作超时

[英]FirebaseError: The datastore operation timed out

I have firestore collection with 50000 document when I'm trying to get all documents using below code I'm getting error当我尝试使用以下代码获取所有文档时,我有 50000 个文档的 firestore 集合我收到错误

const { db } = require("./firebase");

getdata()
function getdata() {
    console.log("entered");
    db.collection("mycollection")
        .where("id", "!=", null)
        .get()
        .then((querySnapshot) => {
            console.log("got res");
            for (let i in querySnapshot.docs) {
                console.log(doc.id, " => ", doc.data());
            }
        });
}

while executing this I'm getting this error执行此操作时出现此错误

D:\project\project_duplicate>node index.js
entered
(node:17848) UnhandledPromiseRejectionWarning: FirebaseError: The datastore operation timed out, or the data was temporarily unavailable.
    at new FirestoreError (D:\project\project_duplicate\node_modules\@firebase\firestore\dist\index.node.cjs.js:266:28)       
    at fromRpcStatus (D:\project\project_duplicate\node_modules\@firebase\firestore\dist\index.node.cjs.js:4522:12)
    at fromWatchChange (D:\project\project_duplicate\node_modules\@firebase\firestore\dist\index.node.cjs.js:4767:35)
    at PersistentListenStream.onMessage (D:\project\project_duplicate\node_modules\@firebase\firestore\dist\index.node.cjs.js:12995:27)
    at D:\project\project_duplicate\node_modules\@firebase\firestore\dist\index.node.cjs.js:12928:30
    at D:\project\project_duplicate\node_modules\@firebase\firestore\dist\index.node.cjs.js:12964:28
    at D:\project\project_duplicate\node_modules\@firebase\firestore\dist\index.node.cjs.js:14554:20
    at runMicrotasks (<anonymous>)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:17848) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:17848) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
[2020-12-03T19:23:10.734Z]  @firebase/firestore: Firestore (8.1.1): Connection GRPC stream error. Code: 1 Message: 1 CANCELLED: Disconnecting idle stream. Timed out waiting for new targets.

The error seems cause by ran out of memory:该错误似乎是由 memory 用完引起的:

The datastore operation timed out, or the data was temporarily unavailable.数据存储操作超时,或数据暂时不可用。

Similar to this case because you have getting and returning a large collection.与这种 情况类似,因为您获取并返回了一个大型集合。 You should apply a limit or batch or pagination query in order to avoid running out of memory and excessive costs.您应该应用限制或批处理或分页查询,以避免用完 memory 和过多的成本。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Internet Explorer错误消息“操作已超时” - Internet Explorer error message “The operation was timed out” PhantomJS 408错误“套接字操作超时” - PhantomJS 408 error “Socket operation timed out” FirebaseError:时间戳超出范围 - FirebaseError: Timestamp out of range MongooseError:操作 .insertOne() 缓冲在 10000 毫秒后超时 - MongooseError: Operation `.insertOne()` buffering timed out after 10000ms 操作 `users.insertOne()` 缓冲在 10000 毫秒后超时,Node.js,MongooseError - Operation `users.insertOne()` buffering timed out after 10000ms in, Node.js, MongooseError 无法获得响应,显示操作 users.findOne() 缓冲在 10000 毫秒后超时 - Not able to get response , showing Operation `users.findOne()` buffering timed out after 10000ms` “消息”:“errorMongooseError:操作 `userinfos.insertOne()` 缓冲在 10000 毫秒后超时” - "message": "errorMongooseError: Operation `userinfos.insertOne()` buffering timed out after 10000ms" “错误:MongooseError:操作 `users.insertOne()` 缓冲在 10000 毫秒后超时”, - "Error: MongooseError: Operation `users.insertOne()` buffering timed out after 10000ms", mongooseError:操作 `users.insertOne()` 缓冲在 10000 毫秒后超时 - mongooseError: Operation `users.insertOne()` buffering timed out after 10000 ms mongooseError:操作 `chatbots.findOne()` 缓冲在超时 10000 毫秒后超时。<anonymous></anonymous> - mongooseError: Operation `chatbots.findOne()` buffering timed out after 10000ms at Timeout.<anonymous>
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM