How can I update all values in a map, using the values from corresponding keys of another map? For example I have the two maps bellow:
map = %{"December 2021" => 0, "November 2021" => 0, "October 2021" => 0}
map_2 = %{"December 2021" => 7, "November 2021" => 6}
And I want to update all values from map with the corresponding values from map_2, so in the end map = %{"December 2021" => 7, "November 2021" => 6, "October 2021" => 0}
I have tried:
Enum.map(map_2, fn {key, value} -> %{map | k => v} end)
I have also tried the code above with other functions like Map.update!/3 and similar ones, but they all return a list with maps for each iteration of Enum.map.
Does someone have any idea on how to do it?
Thanks in advance