Considering following nested structure:
ls = {"a" -> 1,
"b" -> 2,
"c" -> {"AA" -> <|"Aaaa" -> <|"yi" -> 512, "h" -> 45 |>,
"V" -> <|"e2" -> 5, "rr" -> <|"e"->3.14|>|>|>,
"VV" -> <| "e4" -> 123|>}}
I want to update "e4"
key to have 124
value instead of 123
.
I can easily extract the value by "VV" /. ("c" /. ls)
. I can even update the value as follows:
Insert["VV" /. ("c" /. ls), "e4" -> 124, -1]
This nohow affects the ls
.
What is the correct way to update the value exactly in ls
?
Thanks!