update-in is a great feature for updating nested maps.
user> (def data {:config {:example {:a "a" :b "b" :c "c"}} :more {:a "a" :b "b" :c "c"}}) user> (pprint (update-in data [:config :example] assoc :d 4)) {:config {:example {:a "a", :c "c", :b "b", :d 4}}, :more {:a "a", :c "c", :b "b"}}
assoc-in may be a little closer to what you want
user> (pprint (assoc-in data [:config :example :d] 4)) {:config {:example {:a "a", :c "c", :b "b", :d 4}}, :more {:a "a", :c "c", :b "b"}}
to read values ββwithout changing them, you can use the fact that keywords look in maps for writing even more compact form than jquery form
user> (-> data :config :example :a) "a"
source share