Reputation: 139
If I query a collection from firestore with 1 document with 10 text fields in it then will that count as 10 reads or 1 read? And how does the firestore count reads to a database?
Upvotes: 0
Views: 295
Reputation: 50840
It'll cost 1 read. You are charged for reads per document and not the amount of data in the document. Make sure you add a limit
while fetching a collection:
citiesRef.orderBy("name").limit(3);
Since the limit here is 3, it'll charge you (at most) 3 reads. If there's no limit set then the query will fetch all documents costing you N reads where N is number of documents in that collection.
Read more at Understanding Cloud Firestore Billing
Upvotes: 1