How to execute Cypher in a file?

前端 未结 6 1181
情深已故
情深已故 2021-01-04 01:39

I am working on windows. I have created a text file of Cypher query using notepad. How can I run the query in the file using Neo4jShell or Neo4j web interface console.

6条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-04 01:56

    Just add -file as a parameter when starting the console.

    On windows, it would look like this :

    Neo4jShell.bat -file path/to/cql/file 
    

    Or you could also print the result into a new file

    Neo4jShell.bat -file path/to/cql/file > path/to/output/file
    

    I'm also sure there is a way to do it from within the shell and not at startup, as it was once demonstrated to me by Stefan Armbruster but for the love of god, I can't remember how he did it. But this approach works as well.

提交回复
热议问题