问题
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?
回答1:
Note that if you are monitoring/watching your database through the Firebase console, the Firestore documents reads from the Firebase console are included in your Firestore read count/quota.
来源:https://stackoverflow.com/questions/62229630/why-1-document-write-in-firestore-costs-30-reads