Home > Software engineering >  Does the flowing security rule resource.data.someArr.size() cause a read in firebase?
Does the flowing security rule resource.data.someArr.size() cause a read in firebase?

Time:01-12

In security rules does checking against current data in the doc considered read free or is will this technical case the user a read since it is checking data existing in the doc ?

since I have and security rules that check if some array have a certain size on each action and I am not sure if just by checking it will count as a read ?

resource.data.someArr1.size() < 6
resource.data.someArr2.size() < 25
resource.data.someArr3.size() < 25
resource.data.someArr4.size() < 65

CodePudding user response:

Reading the resource data is already available per any read/write request and stored as an object for old data, allowing new and old data to be evaluated - this does not incur any additional reads. Additional reads are done through invoking data methods for external documents such as get() and exists() from security rules. With this, only the last 10 documents are cached for re-use in the same query.

  • Related