// My reference:
let channelRef = UserDataService.instance.FbDB.collection("dmChannels").document(channelId).collection("messages")
.order(by: "timeStamp", descending: true).limit(to: 20)
// My snapshotListener:
let messageListener = channelRef.addSnapshotListener { [weak self](snapshot, error) in
if success {
for message in snapshot!.documents {
let messageDictionnary = message.data()
let messageID = message.documentID
self!.updateMessageToLatest(messageDictionnary: messageDictionnary, messageID: messageID, modified: false) // Does the parsing and checks if the doc is already in the array or not
}
}
}
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/687390db-f65f-4718-91d4-12496b0d67a7%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Firebase Google Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-tal...@googlegroups.com.
To post to this group, send email to fireba...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-talk/b26c0286-0c0a-4e36-ae72-3690813e88ad%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.