I would like to merge nested maps, but I can't figure out how to merge the inner maps.
var a = Map[String,Map[String,String]]()
a = a + ("key1" -> Map("subkey1" -> "a"))
a = a + ("key1" -> Map("subkey2" -> "b"))
a = a + ("key2" -> Map("subkey1" -> "c"))
I would like to merge all of these such that I get the following result:
Map("key1" -> Map("subkey1" -> "a", "subkey2" -> "b"), "key2" -> Map("subkey1" -> "c"))
Is there any standard method for this?
subkey1
under thekey1
map.