1

I have the following data structure:

 {:a {:x 1 :y 2} :b {:w 1 :z 2} :c {:m 1 :n 2}}

How can I transform that into a string-hash-map?

I want the following data structure:

{"a" {:x 1 :y 2} 1 {:w 1 :z 2} 2 "c" {:m 1 :n 2}}
Yavuz Kuru
  • 23
  • 6

1 Answers1

3
(let [data {:a {:x 1 :y 2} :b {:w 1 :z 2} :c {:m 1 :n 2}}]
        (update-keys data name))
=> {"a" {:x 1, :y 2}, "b" {:w 1, :z 2}, "c" {:m 1, :n 2}}
akond
  • 15,865
  • 4
  • 35
  • 55