I am trying to update a document object using object_put but for some reason if the object is missing completely it is not added. I have also tried to add it before the set if is missing, but still object_put doesn’t seems to find it
UPDATE default SET `contextual_tags_data` = OBJECT_PUT(CASE WHEN `contextual_tags_data` IS MISSING THEN {} ELSE `contextual_tags_data` END,"1-1-2",{"tag_source":"auto"});
or
UPDATE default SET `contextual_tags_data` = CASE WHEN `contextual_tags_data` IS MISSING THEN {"1-1-2":{"tag_source": "auto"}} ELSE OBJECT_PUT(`contextual_tags_data`,"1-1-2",{"tag_source":"auto"}) END ;
or as 2 statements, one to update to {} where the field is missing, and the second a simple OBJECT_PUT.