Skip to content

Instantly share code, notes, and snippets.

@freeeve
Created November 13, 2012 20:54
Show Gist options
  • Save freeeve/4068332 to your computer and use it in GitHub Desktop.
Save freeeve/4068332 to your computer and use it in GitHub Desktop.
cypher shell script
Wess-MacBook-Pro:bin wfreeman$ cat test.cypher
create (m {name:"m"});
create (n {name:"n"});
Wess-MacBook-Pro:bin wfreeman$ ./neo4j-shell -c < test.cypher
Welcome to the Neo4j Shell! Enter 'help' for a list of commands
NOTE: Remote Neo4j graph database service 'shell' at port 1337
neo4j-sh (?)$ create (m {name:"m"});
+-------------------+
| No data returned. |
+-------------------+
Nodes created: 1
Properties set: 1
8 ms
neo4j-sh (?)$ create (n {name:"n"});
+-------------------+
| No data returned. |
+-------------------+
Nodes created: 1
Properties set: 1
6 ms
@jexp
Copy link

jexp commented Nov 14, 2012

And you can even use begin at the beginning and commit at the end so that all are executed in a single tx and will be rolled back on failure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment