Firestore 定价 - 集合中的文档数量重要吗? [英] Firestore Pricing - Does The Amount Of Documents In A Collection Matters?
问题描述
我已在文档中阅读我需要支付的费用我对 read
、write
或 update
documents
的请求.我还读到,阅读 collection
的价格与阅读 document
的价格相同(对于文档读取以外的查询,例如对列表的请求的集合 ID,您需要为阅读一份文档付费."),如果我错了,请纠正我.
我的问题是:阅读包含大量 documents
的 collection
(比如说 - 10,000 个 documents
)是否需要花费和 10 读一读一样吗?
我想得到一些关于它的解释...
这取决于读取集合"的含义,但对于大多数人来说,这意味着从集合中查询一堆文档".答案是定价通常取决于检索的文档数量.
把事情简单化一点:
如果您有 10 个员工的集合,并且您运行 collection("employees").get()
调用,您将获得 10 个员工文档,并收取 10 次读取费用.
如果您有 10,000 名员工的集合,并且您运行 collection("employees").get()
调用,您将收回 10,000 名员工,并收取 10,000 次读取费用.>
如果您有 10,000 名员工的集合,并且您运行 collection("employees").get().limit(10)
调用,您将收回 10 名员工,并收取10 次阅读.
如果您有 10,000 名员工的集合,其中 4 名名为Courtney",并且您运行了一个 collection("employees").where("first_name", "==", "Courtney")
调用,你会找回 4 名员工,并收取 4 次读取费用.
I have read in the documentation that I'm being charged for the amount of the requests I'm making to read
, write
or update
documents
. I have also read that reading a collection
is priced the same as a reading a document
("For queries other than document reads, such as a request for a list of collection IDs, you are billed for one document read."), correct me if I'm wrong.
My question is: Does reading a collection
with a big amount of documents
in it (let's say - 10,000 documents
) is priced the same as reading one with 10?
I'd like to get some explaination about it...
It depends on what you mean by "reading a collection", but for most people this means "querying a bunch of documents from a collection". And the answer is that the pricing generally depends on the number of documents retrieved.
To oversimplify things just a bit:
If you have a collection of 10 employees and you run a collection("employees").get()
call, you will get back 10 employee documents, and be charged for 10 reads.
If you have a collection of 10,000 employees and you run a collection("employees").get()
call, you will get back 10,000 employees, and be charged for 10,000 reads.
If you have a collection of 10,000 employees and you run a collection("employees").get().limit(10)
call, you will get back 10 employees, and be charged for 10 reads.
If you have a collection of 10,000 employees, 4 of which are named "Courtney" and you run a collection("employees").where("first_name", "==", "Courtney")
call, you will get back 4 employees and be charged for 4 reads.
这篇关于Firestore 定价 - 集合中的文档数量重要吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!