Reputation: 1166
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.
What does count as a read operation?
.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.
I'm using Node SDK.
Thanks
Upvotes: 7
Views: 6905
Reputation: 138824
From the offical documentation regarding listening to query results:
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.
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.
Upvotes: 10