I think i'm right and Firebase had a childAdded method and a listener which meant that all the data was loaded the first time around and then the listener would observe for each time a new piece of data was added/modified/etc.
Using Firestore I call the following on the database when my app loads:
func loadMessageRequests()
{
defaultStore?.collection("requests").getDocuments() { (querySnapshot, err) in
if let err = err {
print("Error getting documents: \(err)")
} else
etc.
And I populate a dictionary with the requests.
But I also want to listen for any changes to the db and if any requests are added, etc. and at the moment I've got a separate listener in a controller doing the listening
let listener = model.defaultStore?.collection("requests")
.addSnapshotListener { querySnapshot, error in
And I was just wondering whether there was an equivalent for childAdded where I can have a listener on the db while also having loaded all the data initially.
Thanks.