Clojure - extract values from a vector of hashmaps
(map #(get % "key1") myvec)
should be all you need.
(let [v [{"key1" "value1", "key2" "value2"} {"key1" "value3", "key2" "value4"}]]
(vec (map #(% "key1") v)))
If you use keywords for your keys:
(let [v [{:key1 "value1", :key2 "value2"} {:key1 "value3", :key2 "value4"}]]
(vec (map :key1 v)))
If you don't want to include nil
values when the maps don't have the given key:
(let [v [{:key1 "value1", :key2 "value2"} {:key1 "value3", :key2 "value4"} {:key2 "value5"}]]
(vec (keep :key1 v)))