Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I change objects inside an array in CloudFirestore? [duplicate]

I need to add / change / delete objects inside an array that is inside a document, I would like to know if I have to update all the data that will be sent, or if I can only change the specific object that is inside the array.

I have a form with many fields, I would just like to update a specific object ... Do I have to send the entire object or can I only update the specific object?

enter image description here

Is it possible to add / change / delete only objects that are within plans? Or do I need to send every object in the image to update plans together?

like image 695
Luiz Ricardo Cardoso Avatar asked Aug 28 '26 20:08

Luiz Ricardo Cardoso


1 Answers

You can't update individual items in an array. You have to send the entire array with each update.

On that note, sometimes it's better to use an object if you just want to change individual elements if you already know their names.

like image 167
Doug Stevenson Avatar answered Aug 31 '26 10:08

Doug Stevenson