cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Cypher-Shell - how to run testquery.cypher in background

Kailash
Graph Buddy

I have a simple question on cypher-shell as i didnt find much of documentation on this.

What i am running is some command to load data from csv from cypher shell

SNO,EmailId,FirstName,EmailId,LastName,HiringDate;
1,10001,Test1,abc@test1.com,"TestUser1,2019-02-05;
2,10002,Test2,abc@test2.com,TestUser2,2019-02-05;
3,10003,Test3,abc@test3.com,TestUser3,2019-02-05;

my testquery.cypher -
USING PERIODIC COMMIT 1000 LOAD CSV WITH HEADERS FROM "file:///test1.csv" AS eachLine FIELDTERMINATOR ',' WITH eachLine return eachLine ;
I am doing some operation post this.. removed from sample query
I am running this --

cat testquery.cypher | cypher-shell -u neo4j -p 'XXXXX' from leader.

This will work fine, but since the data is large, i want to run it in background.
So question I have : is there anyway to run it in background.

1 ACCEPTED SOLUTION

I knew about & in the end but didnt know this will work while calling cypher-shell . Thanks
This worked

View solution in original post

2 REPLIES 2

presuming this is linux? simply append a & to the command and thus

cat testquery.cypher | cypher-shell -u neo4j -p 'XXXXX'  &

& isnt a Neo4j implementation rather simply a linux implementation and available for most any command line invocation. See https://linuxize.com/post/how-to-run-linux-commands-in-background/ for more details

I knew about & in the end but didnt know this will work while calling cypher-shell . Thanks
This worked

Nodes 2022
Nodes
NODES 2022, Neo4j Online Education Summit

All the sessions of the conference are now available online