Search code examples
iosfirebasegoogle-cloud-firestoreswift4

How can i update an object (map) in an array with swift in firestore database?


I want to update a field of an object that the object is in an array in the Firestore database with Swift 4. These two functions (arrayUnion() and arrayRemove() ) are not working for me.

Here my Database schema:

ScreenShot

I want to update the "Status" field in The first array element.


Solution

  • first of all I want to thanks to @Doug Stevenson for his kindly response. in my case, I must change the array of the objects to sub collections.