public
Last active

cypher shell script

  • Download Gist
neoexample.sh
Shell
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
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

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.

Please sign in to comment on this gist.

Something went wrong with that request. Please try again.