I'm following the documentation of firestore here and trying to attach a snapshot listener on a collection for getting realtime updates.
I'm having trouble trying to differentiate between whether a response from the Snapshot event listener is a first time response (in which case all the documents in the collection will be returned) or a change event response in which case I want to add the check to identify what change happened. This footnote in the same documentation which goes as :
Important: The first query snapshot contains added events for all existing documents that match the query. This is because you're getting a set of changes that bring your query snapshot current with the initial state of the query
doesn't mention how to identify a first query snapshot with that of subsequent ones.
Only related question I can find on SO is this one but it wouldn't help in my case.
Any help is really appreciated since I've run out of directions to go to.
Thanks.