I am using Firebase Firestore to create a log system. The structure is:
- collection: errors
- entry for error 1
- entry for error 2
- ...
I add an error like so:
val error = hashMapOf(
"datetime" to FieldValue.serverTimestamp(),
"errorMessage" to errorMessage
)
database.collection("errors")
.add(error)
Then I watch at how the costs are affected by this operation. Regarding the write count, it obviously adds 1 write operation.
The problem comes with the read operations. For some reason, executing this code causes:
- More than 30 reads
- The read count keep increasing as the time pases, even if I kill the app.
Why a write operation cost so many read operations?