Clean up fetching recipes from db

This commit is contained in:
Nicholas Kariniemi 2014-07-03 19:02:39 +03:00
parent 7bb5186e3d
commit 80566eed03

View file

@ -67,13 +67,11 @@
(vec)))
(defn get-current-recipes []
(let [raw-recipes (mc/find-maps @db recipe-collection)
sorted-recipes (sort-by :_id (vec raw-recipes))
recipes (map (fn [r] (-> r
(select-keys [:_id :name :grubs])
(clojure.set/rename-keys {:_id :id})))
sorted-recipes)]
recipes))
(->> (mc/find-maps @db recipe-collection)
(sort-by :_id)
(map #(select-keys % [:_id :name :grubs]))
(map #(clojure.set/rename-keys % {:_id :id}))
(vec)))
(def production-db "grub")
(def development-db "grub-dev")