Alejov
Alejov

Reputation: 529

Does a collection('name').get() counts as 1 read, or as many reads as documents inside that collection?

My question is pretty straightforward, i couldn't find any resources in firebase documentation nor pricing about this, each time i call.

firestore.collection('users').get()

If i had 5 users, does that count in the pricing as 1 read, or as 5 reads?

Upvotes: 1

Views: 1431

Answers (2)

Iter8
Iter8

Reputation: 51

When you use Cloud Firestore, you are charged for the following: The number of documents you read, write, and delete. The number of index entries matched by aggregation queries. You are charged one document read for each batch of up to 1000 index entries matched by the query.

Please note the following update to the link documentation for Firestore pricing You are charged one document read for each batch of up to 1000 index entries matched by the query.

Upvotes: 0

Doug Stevenson
Doug Stevenson

Reputation: 317362

You are billed 1 read for each document returned by the query. Since your query is fetching all of the documents in the collection, if you have 5 documents, it will be 5 reads.

The documentation for Firestore pricing should give you all the details you need.

Upvotes: 1

Related Questions