when trying to add an element to an existing array in firestore I get the error "Cannot convert value of type 'String' to expected argument type '[Any]'"
this is the method where the error occurs:
func addEventIdToUser(eventID: String) async {
let db = Firestore.firestore()
let userReference = try await db.collection("user").document(userID)
try? await userReference.updateData(["events": FieldValue.arrayUnion(eventID)])
}
does anyone know how to solve the issue?