Closed SeriousM closed 1 year ago
Hi, the DocumentChange
object did include indeed a reference to the IDocumentSnapshot
interface which was rather useless. I've created a new version 1.2.5 of the plugin which references the IDocumentSnapshot<T>
interface instead, so you can now use its Data
property to access your data regarding to the change like this:
onChanged.DocumentChanges.First().DocumentSnapshot.Data
The GetDocumentChanges()
method returns an enumerable of the documents that changed since the last snapshot. You can pass true
or false
to it to include metadata-only changes, so I think that's why the method exists.
You can take a look at the official firebase docs for additional information. Furthermore I've incooperated this new code at the gets_real_time_updates_on_multiple_documents()
test method of the FirestoreFixture
, so you can take a look there as well.
Hi Tobias, thank you again for your excellent support and all that information. I will check this new version tomorrow. You're work is very appreciated!
Hi!
When I use
ICollectionReference.AddSnapshotListener<T>(onChange => {...})
theonChange
contains two collections:DocumentChange
which consists ofChangeType
andDocumentSnapshot
of typeIDocumentSnapshot
.IDocumentSnapshot
is empty - no reference to the actual document.GetDocumentChanges()
which returns a list ofDocumentChange
as theDocumentChanges
property above.How do I get the document to the document change like
Thanks!