The Firestore database has the following field structure
images: {day: ['url1', 'url2', 'url3,] night: ['url1']}
First I would like to be able to append a value to the arrays. Did try the following:
await updateDoc(doc(firestore, FIRSTORE_COLLECTIONS.IMAGES, id), {
[folder]: {
[key]: arrayUnion(fileUrl)
}
It went to the right images: path but unfortunately this just created a new array with one value and removed the ones that where there.
Secondly. If I also like to be able to create a new array in the same path with a key that does not exist can this be done and how could that be solved with this setup any ideas?
dependencies: "firebase": "^9.1.1", "react": "^17.0.2"