I got this data in my document:
I want to delete index 0. How do I do this? This should do the trick I thought:
db.collection(\"data\").
export const deleteArrayIndex = (collectionName, id, index) => {
db.collection(collectionName).doc(id).update(
{ [index]: firebase.firestore.FieldValue.delete() }
).then(function () {
console.log(index + " is deleted");
}).catch(function (error) {
console.error("Error removing document: ", error);
});
}