在Firestore中什么算作读取操作? [英] What counts as a read operation in Firestore?

查看:75
本文介绍了在Firestore中什么算作读取操作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这听起来可能很愚蠢,但是我对Firestore的定价有些困惑.

This may sound silly but I'm a little bit confused with Firestore pricing.

我在这里还阅读了其他问题,阅读了文档并观看了一些视频.

I've read other questions here, read the doc and watched a few videos.

什么算作读操作?

.get() or .data();

我尝试通过使用邮递员和玩邮递员查看配额来弄清楚自己,但读取操作计数并未增加.

I tried figuring out myself by viewing the quota using and playing with Postman, but the read operation count is not increasing.

我正在使用Node SDK.

I'm using Node SDK.

谢谢

推荐答案

摘自有关侦听的官方文档查询结果:

当您收听查询结果时,每次在结果集中添加或更新文档时,您都要付费.

When you listen to the results of a query, you are charged for a read each time a document in the result set is added or updated.

倾听行为本身并不算作阅读,但是每个查询最少要收取一个文档.在定价页面的查询的最低费用"下:

The act of listening does not itself count as a read, however there is a minimum of one document charged per query. From the pricing page, under "Minimum charge for queries":

即使查询没有返回结果,对于您执行的每个查询,最低读取一个文档的费用.

There is a minimum charge of one document read for each query that you perform, even if the query returns no results.

如果您要调用 .data(),则意味着您要查找的文档已存在于数据库中,并且您已经在回调函数内部.换句话说,已经执行了 .get()调用,并且您已经承担了读取操作的费用.

If you are about to call .data() it means that the document that you are looking for exist in the database and you are already inside the callback. With other words, the .get() call was already performed and you are already charged with a read operation.

请注意,如果您重新收听一小会儿,则自上次收听以来从未更改过的文档不会收取费用.

Please also note that, if you re-listen a short while after you've already done so, you won't get charged for documents that haven't changed since you listened last.

这篇关于在Firestore中什么算作读取操作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆