0

I want to update the booked field (best would be toogle). The booked field is inside a map wich itself is inside an array. I have the index of the map, i just dont get how to navigate to the "booked" field. I can also read the doc etc. no problem there.

enter image description here

If relevant the code is in react

I really tried a lot of different ways. How hard can it be to update a field in a db. So i thought anyways.

every help is highly appreciated

Doug Stevenson
  • 297,357
  • 32
  • 422
  • 441
Ni3o
  • 1
  • 1
  • In short - read the document, modify the array in memory, update the document with the new array. There is no other way. – Doug Stevenson Dec 18 '22 at 19:48
  • If you can, change the array into a map. Check this https://stackoverflow.com/questions/62276269/how-to-delete-the-array-elements-at-index-in-firestore-in-javascript/62278041#62278041 – l1b3rty Dec 19 '22 at 10:54
  • @l1b3rty Thanks, i will change to nested maps – Ni3o Dec 20 '22 at 15:31

0 Answers0