I've a model like this
{
"actions": [
{
"type": "1",
"value": {
"abc": {
"1": "true"
},
"def": {
"1": "true"
}
}
}
]
}
I would like to delete abc field
Here's code im using but it did not work for me( Also i'm using batched writes to update multiple documents).
// getScene's data received from firestore
let batch = this.firebase.firestore().batch();
getScene.forEach(o => {
let removeDeviceFromScene = this.sceneDoc.doc(o.id);
const fieldPath = `actions.value.abc`;
batch.update(removeDeviceFromScene, {
filePath: this.firebase.firestore.FieldValue.delete()
}
}); await batch.commit().then(() => {
console.log(`Begin write batch`);
});
i've also tried like this but same result
let update = {};
let removeDeviceFromScene = this.sceneDoc.doc(o.id);
update["actions.value.abc"] = this.firebase.firestore.FieldValue.delete();
batch.update(removeDeviceFromScene, update);
Is there something wrong with my code, any solution for this problem?
Thanks in advance