I have the flowing object that I want to remove data-set-1 and keep the other sets is this possible in the context of the current nesting ?
//Firebase object model
tracked : {
data-set-1: [11,3423,4232,23324,123,3123123]
data-set-2: [22,4434,4232,5554,123,3123123]
data-set-3: [33,3423,4232,23324,123,31553123]
}
const deleteData = async()=> {
const docRef = doc(db, 'data-users', currentUser.uid);
await updateDoc(docRef, {
tracked :{
['data-set-1']: FieldValue.delete(),
}
});
}}
caught (in promise) FirebaseError: Function updateDoc() called with invalid data. deleteField() can only appear at the top level of your update data