gpt4 book ai didi

google-cloud-firestore - Firestore 查询的默认限制是多少?

转载 作者:行者123 更新时间:2023-12-01 01:41:47 28 4
gpt4 key购买 nike

假设我有一个集合 mycollection有 1,000,000 条记录。

此查询将返回多少条记录?

const query = firestore.collection('mycollection').get()

我在文档中找不到。

最佳答案

没有默认限制。您显示的查询要求获取 mycollection 中的所有文档.对于大型集合,您将需要施加限制以避免成本过高和内存不足。

来自 firebase.google.com文档:

By default, a query retrieves all documents that satisfy the query in ascending order by document ID. You can specify the sort order for your data using orderBy(), and you can limit the number of documents retrieved using limit().

关于google-cloud-firestore - Firestore 查询的默认限制是多少?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55823784/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com