简体   繁体   English

Firebase 读取文档查询的计算?

[英]Firebase read calculations for document queries?

Quick question about how firestore reads are calculated.关于如何计算 firestore 读取的快速问题。 Say I have a collection with 100 items in it, and I do假设我有一个包含 100 件物品的收藏品,我这样做了

citiesRef.order(by: "name").limit(to: 3)

This would technically have to look at all 100 items, order them by name, and then return 3. Would this count for 3 reads or would it count for 100 reads, since we're looking at 100 items?这在技术上必须查看所有 100 个项目,按名称排序,然后返回 3。这算作 3 次读取还是算作 100 次读取,因为我们正在查看 100 个项目?

Thanks.谢谢。

If the above query returns 3 documents then it would count as 3 reads.如果上面的查询返回 3 个文档,那么它将被计为 3 次读取。

You are charged for each document read, write, and delete that you perform with Cloud Firestore.您需要为使用 Cloud Firestore 执行的每个文档读取、写入和删除付费。

Charges for writes and deletes are straightforward.写入和删除的费用很简单。 For writes, each set or update operation counts a single write.对于写入,每个设置或更新操作都算作一次写入。

Charges for reads have some nuances that you should keep in mind.读取费用有一些细微差别,您应该记住。 The following sections explain these nuances in detail以下部分详细解释了这些细微差别

https://firebase.google.com/docs/firestore/pricing#operations https://firebase.google.com/docs/firestore/pricing#operations

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM