I want to create a new map if it doesn't exist and then add an attribute to that map. Something like this:
SET #A = if_not_exists(#A, :emptyMap), #A.#B = :somevalue
However doing the above gives me the error saying Two document paths overlap with each other
The only other thing I am thinking to do is do TWO updates, one to create any empty maps and then another to set attributes.
Is there a way to do it in a single update ?
Update
Another use case is creating maps that contain other maps. Currently the only way I can think of to create the following is 3 separate update calls to create the maps if necessary and then another update call to add attributes:
{
Entities: { A: { B: {} } },
}
There must be a better way.