I went through the documentation for Firestore pricing but was unable to find a clear answer to my question. Let's say I have a collection called posts and users pull down every document in the collection 'posts'. Now if the rule evaluation is such that
match /posts/{post}
allow read: if get(/databases/$(database)/documents/users/$(request.auth.uid)).data.hasSubscribed == true;
and the user pulls down 50 posts, will I be charged 50 additional reads (corresponding to the rule evaluation for every single document being requested in the query) because of the get call, making the total reads equal to 100 or will I be charged only 1 read for the entire query thus making the total number of reads equal to 51?
If you scroll down to Cloud Firestore Security Rules section, it says:
You are only charged one read per dependent document even if your rules refer to that document more than once.
In your security you are accessing only 1 document get(/databases/$(database)/documents/users/$(request.auth.uid));
. Even if you are fetching 50 documents, you are only charged once for that single document (for that request) i.e. costing you 51 reads.