gpt4 book ai didi

firebase - Firestore 读/写定价; .limit(25) 算作 25 次读取还是 1 次?

转载 作者:行者123 更新时间:2023-12-02 08:04:54 27 4
gpt4 key购买 nike

我有点困惑,对于 Firestore 定价,像下面这样的查询算作一次读取还是 25 次读取?

queryRef.limit(25).get().then(()=>{

...

});

据我了解,在 pricing图表中“文档读取”已被定义为单位,但我对上面这样的查询有点困惑,需要确认。

最佳答案

如果您的查询返回 1 个文档,您将需要支付 1 次阅读费用。如果您的查询返回 25 个文档,您将需要支付 25 次读取费用。文档在查询中不能被“读取”,除非在使用偏移量跳过文档的情况下。根据documentation :

There are no additional costs for using cursors, page tokens, and limits. In fact, these features can help you save money by reading only the documents that you actually need.

However, when you send a query that includes an offset, you are charged a read for each skipped document. For example, if your query uses an offset of 10, and the query returns 1 document, you are charged for 11 reads. Because of this additional cost, you should use cursors instead of offsets whenever possible.

关于firebase - Firestore 读/写定价; .limit(25) 算作 25 次读取还是 1 次?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48454920/

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