When using firestore
snapshot()
, and set a listener, Cloud Firestore sends your listener an initial snapshot of the data, and then another snapshot each time the documents change.
However if I close the app, and reopen it, does firestore make a read on all the data it already has queried or is there an internal sync system (for example if they store documents metadata, like updatedAt
they could only read documents that haven't been updated since x) ?
In other words. if I use onSnapshot()
listener, I will make x documents read initially, then 1 document each time a document changes. My question is: If I close the app and a document changes, then when I open the app, is 1 read made or x + 1 ?
It is important for me because I have a bunch of initial calls and I'm wondering how that'd affect the cost($).
It's also important to know for data modeling and how it affects the cost.
question from:
https://stackoverflow.com/questions/65928578/does-firestore-snapshost-listeners-do-an-initial-document-read-every-data-ever 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…