I'm trying to remove some portions of data from documents with given fairly simple structure, which will get much deeper and heavier than this as the project goes:
{
id: "...",
name: "...",
phone: "...",
data: {
key1: "val1",
...
}
...
}
I'm aware that there is no way of updating/removing sections from the nested parts other than replacing the whole tree with updated tree.
For example, if I want to delete key1 from document data, I need to update the documents data section with a copy of it where key1 is not contained
document.update({data: new dict without key1})
Is there any eaiser way of deleting a portion from the root of document -like name field- without updating the whole document with a copy of itself that does not contain the name key and value? Do I have to deep copy and filter the document every time i need to remove some portions of data?