https://firebase.google.com/docs/firestore says:
Like Realtime Database, Cloud Firestore uses data synchronization to update data on any connected device.
I'm trying to figure out what this "data synchronization" consists of.
https://firebase.google.com/docs/firestore/manage-data/enable-offline says:
When persistence is enabled, Cloud Firestore caches every document received from the backend for offline access.
Does Cloud Firestore update that cache whenever changes happen in the back end? For example, if I have a certain document in my cache, does the document update (a) automatically when that document is changed in the back end or (b) whenever I do a query that uses that document, and I happen to be online at the time?
UPDATE
I'm going to restate my last paragraph, because it's been misunderstood by at least one person.
Imagine the following scenario:
- I have a smartphone. To make things easy, assume the smartphone is online all the time.
- Installed on this smartphone is a mobile app that contains the Firestore SDK.
- The app has enabled the Firestore cache.
- The cache contains, say, 1000 documents.
Now my question is: if one of these documents changes in the cloud (not on the smartphone), under what circumstances will the Firestore SDK update the document in the cache? Will it (a) update the document automatically, soon after the change on the cloud, or (b) update the document the next time the mobile app does a query that uses the document?