Reputation: 166
I use Firestore ServerTimestamp in many documents.
With collection listeners, I can monitor that if a document has SeverTimestamp field value it’s updated twice, first one with ServerTimestamp value null.
I wonder that Is second document update counted when it comes to pricing?
Upvotes: 0
Views: 228
Reputation: 317828
No, it's just one write.
What you're observing is the client listener being invoked twice, once when the timestamp is unknown, and again when the timestamp is known by the server and reflected back in the client. Just because the client listener is invoked twice, it doesn't mean there were two writes.
Upvotes: 2
Reputation: 600006
If you create or update a document with a server-side timestamp your client will see two events:
But there is only a single write operation that happens on the server, so you will only be charged for a single write.
Upvotes: 4