Skip to content

Instantly share code, notes, and snippets.

@l1x l1x/filter.clj
Created Mar 17, 2014

What would you like to do?
(def sample-data [
{ :id "bf9eb73e-a8c8-11e3-9be7-425861b86ab6" :type "PrestoDB"
:version "0.60" :host "" :port "8080"}
{ :id "bf9eba36-a8c8-11e3-9be7-425861b86ab6" :type "PrestoDB"
:version "0.60" :host "" :port "8080"}
{ :id "bf9ebc5c-a8c8-11e3-9be7-425861b86ab6" :type "PrestoDB"
:version "0.60" :host "" :port "8080"}
{ :id "bf9ebe5a-a8c8-11e3-9be7-425861b86ab6" :type "PrestoDB"
:version "0.60" :host "" :port "8080"}])
(defn db-get [id] (first (filter #(=(:id %) id) sample-data)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.