'Firestore pricing for `.get()` on a full collection without invoking `.data()`

I have a collection with thousands of records. When I perform .get() on the full collection, the query results seem to occupy (relatively) lower amount of memory which indicates that all the data isn't contained in the result set and we do a .data() to fetch the document.

So does that indicate that I am only billed for one document read for a .get() on full collection? Or am I billed for the total no. of documents contained in the result of the .get() (even if I don't run the .data() on snap.docs)?



Solution 1:[1]

I billed for the total no. of documents contained in the result of the .get()

Yes, you are charged for number of documents returned by your query. (Total number of docs in the collection in this case since you are fetching whole collection)

Even if I don't run the .data() on snap.docs

When you use get(), you've already queries required documents. .data() just returns data from the snapshots received.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Dharmaraj