2
votes

I am storing a collection of documents of blocked users. I am checking if the request is from a blocked user or not by checking if the email exist within the blocked collection

allow read: if exists(/databases/$(database)/documents/blocked/$(request.auth.token.email)) == false;

does checking if the document exist count as a read?

2

2 Answers

3
votes

Yes, exists() counts as a read toward your billing. They also count against the max number of reads you can perform per request.

0
votes

well exits() does not count as read, it is called on a document that was already read using get(), once a document is read, you can call exits() any times without re-reading