1

i used firestore and i just want to passed the statut:'en attente' to statut:'validé' but when i tried to update it, it remove all my object. i tried a few different solution, like the .set {merge:true} but it still remove evrything. Do you guys have some ideas ?

this is my nest object enter image description here

This is also my code :

firestore()
                                .collection("Teams")
                                .doc(doc.id)
                                .update(
                                  {
                                    membersList: { statut: "Validé" },
                                  },
                                  
                                );
Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Wendy Montagnon
  • 155
  • 1
  • 10
  • You cannot update an existing item in an array. You will have to: 1) Read the document, 2) Get the entire array from that document, 3) Update the array, 4) Write the entire updated array back. See https://stackoverflow.com/questions/46757614/how-to-update-an-array-of-objects-with-firestore/46773121#46773121 – Frank van Puffelen Apr 09 '21 at 23:04

0 Answers0