Skip to content

Instantly share code, notes, and snippets.

@ducky427
Last active August 29, 2015 14:04
Show Gist options
  • Save ducky427/be8c1803368ae91e636d to your computer and use it in GitHub Desktop.
Save ducky427/be8c1803368ae91e636d to your computer and use it in GitHub Desktop.
Bulk create test using neocons
(ns bulk-test.core
(:require [clojurewerkz.neocons.rest :as nr]
[clojurewerkz.neocons.rest.nodes :as nn]
[clojurewerkz.neocons.rest.cypher :as cy])
(:gen-class))
(defn create-nodes
[conn num]
(let [nodes (repeat num {:name "Joe Bloggs" :age 32})]
(nn/create-batch conn nodes)))
(def ^:const query "CREATE (n:Person { props } ) RETURN n")
(defn create-nodes-cypher
[conn num]
(let [nodes (repeat num {:name "Joe Bloggs" :age 32})]
(cy/tquery conn query {:props nodes})))
(defn -main
[& args]
(let [conn (nr/connect "http://localhost:7474/db/data/")]
(time (create-nodes conn 80))
(time (create-nodes conn 800))
(time (create-nodes conn 800000))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment