This Firestore documentation item (Section "Listening to query results") will give you the answer:
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. You are also charged for a read when a document is removed from the result set because the document has changed. (In contrast, when a document is deleted, you are not charged for a read.)
Also, if the listener is disconnected for more than 30 minutes (for
example, if the user goes offline), you will be charged for reads as
if you had issued a brand-new query.
In other words, if your query limits the number of documents returned to 5 (e.g. with limit()
, as explained here), you will only pay for 5 document reads (unless you are using a listener -and not get()- and a document is created/modified/deleted and changes the top 5 or unless you encounter the 30 minutes disconnection specific case mentioned above).
On the other hand, if you filter the top 5 docs on the client-side, after receiving the entire set of documents, you will obviously be charged for the full set.