Bumuthu Dilshan
Bumuthu Dilshan

Reputation: 430

Does Firestore database count more document reads when applying multiple conditions?

Consider this example

citiesRef.where("state", "==", "CO").where("name", "==", "Denver").get().then( res => ... );

Assume there are 10 documents satisfying the first condition, 20 documents satisfying the second condition and only 5 documents satisfying the both conditions.

How many document reads does Firestore count ?

Upvotes: 2

Views: 249

Answers (1)

Alex Mamo
Alex Mamo

Reputation: 1

How many document reads does Firestore count?

You'll be charged with a number of document reads that is equal with the number of documents that are returned by your query. So if your combined query will return 5 elements, you'll only be charged with 5 reads.

Upvotes: 3

Related Questions