Clojure: Hash Map to CSV

I’m sure this is not the best solution but I’m happy with how it turns out, so far. ?

(defn hashmap->csv
  [records record-keys]
  (clojure.string/join
    "\n"
    (map (fn [row] (clojure.string/join "," row))
         (map (fn [record]
                (map (fn [rec-key]
                       (rec-key record))
                     record-keys))
              records))))


(def hm [{:id 1 :name "first"}
         {:id 2 :name "second"}
         {:id 3 :name "third"}
         {:id 4}])

(def ks [:id :name])

(hashmap->csv hm ks)                                        ;=>"1,first\n2,second\n3,third\n4,"