Last active
July 17, 2016 14:51
-
-
Save devstopfix/75772740cfd89d316edec078df5b9ce7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
; Neo4J CREATE | |
(defn- format-props [props] | |
"Format a map of {:symbol String} to Cypher format" | |
(->> | |
props | |
seq | |
(map (fn [[k v]] (format "%s: %s" (name k) (pr-str v)))) | |
(clojure.string/join ", "))) | |
(defn cypher-create [node props] | |
"Return a Cypher CREATE statement for given node and map of properties" | |
(format "CREATE (%s {%s})" node (format-props props))) | |
;(cypher-create "n:Person" {:name "Andres" :age 25}) | |
;=> "CREATE (n:Person {name: \"Andres\", age: 25})" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment