I have the following collection:
And within this collection (0) I have nested modules -> videos as shown below:
What I want to achieve is that in the section, for example: modules[0].videos[0], the property finishedState = true. I am trying as follows:
try {
const cursos = doc(firebase.db, "misCursos", "7eIHn6FtYIOcFEWq2mXE");
await updateDoc(cursos, {
"0.modulos.0.videos.0.videoFinalizado": true,
});
} catch (error) {
console.log(error);
}
But this removes all other modules with their videos and leaves me only **modules[0] -> videos[0] -> **finishState: true
My question is, how can I do to modify ONLY the property that belongs to that section?