Reputation: 2952
I have created a function in Cloud Function
which counts the number of documents within a Collection. Every time a new document is added, the counter is increased by one. I know that we are charged for each document read, write or delete but when Firebase Functions increases the counter, does this write operation also count? Or is an internal operation and it doesn't matter?
Thanks in advance!
Upvotes: 2
Views: 1028
Reputation: 598718
This depends on where the Cloud Function stores the counter. If the counter is stored in a document, then each time you update the counter you are writing a document. So in that case it will indeed count as a document write.
Upvotes: 2