Batch Cypher query in neo4j shell

I would like to run the following command, batch cypher query in neo4j shell 

  • MATCH a-[r]->b where r.lid = ‘1140000201’ SET r.lane = ‘0’; 
  • MATCH a-[r]->b where r.lid = ‘1140022200’ SET r.lane = ‘0’;
  • MATCH a-[r]->b where r.lid = ‘1140024400’ SET r.lane = ‘0’;

First, I think it is impossible, then I found this very helpful solution from https://gist.github.com/wfreeman/4068332 :

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
 
Thank you very much, you save my day 🙂
Advertisements