I hope this thread is still available. I actually have the same question as Azim, so I'd like to add some more details to it (
My Cloud Firestore's chat collection has a nested array called 'messages'.
Chat collection: [
"chatMember": ["member1", "member2"],
"createdAt" : Date().timeIntervalSince1970,
"meesages" : []
]
My goal is to append objects, aka Dictionary ([String: Any]) into the messages array.
Firestore document <
Link> introduces
FieldValue.arrayUnion() & .arrayRemove() to
update elements in an array.
But this doesn't work on Swift with an error saying, "Contextual type '[Any]' cannot be used with dictionary literal".
I saw a Youtube video that uses the .arrayUnion method with Angular and it works perfectly, but Swift doesn't work when I try to do the same.
I hope my explanation clears your confusion and I very much look forward to hearing back from you Kato.
Thank you in advance for your help.