1

I have a CQL file called Novis.cql. Its somewhere random on my harddrive, but I want to run it in Neo4J to create my graph (it contains 500+ lines of code).

Where do I have to place it? And what command do I have to run nowadays to get it working? I've read and searched for answers, but some of the commands like Neo4jshell dont seem to work any longer...

Any help would be very appreciated!

Spkch
  • 11
  • 2

1 Answers1

1

The cypher-shell tool has been available for a while (starting with version 3.0, if not earlier), and you can use it to execute a Cypher query from a file that can be anywhere in your file system.

For example (on a linux/unix system), a command line like this will work (if you are in the neo4j home directory):

cat /my/full/path/my_code.cql | bin/cypher-shell -u neo4j -p secret

In neo4j 4.0 a new -f option was added to make it simpler:

bin/cypher-shell -u neo4j -p secret -f /my/full/path/my_code.cql
cybersam
  • 63,203
  • 6
  • 53
  • 76
  • Thanks for your answer! Does this mean I need to put my CQL file in the Neo4j base folder? installation-4.0.0\bin in this case? And is this the same for windows or is that a different code? – Spkch Mar 16 '20 at 11:30
  • No, the file can be anywhere that is accessible. Windows has its own commands (e.g., `TYPE` instead of `CAT`), and its own file path syntax. – cybersam Mar 16 '20 at 18:12