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.
相关问题
- Can I parameterize labels and properties on CREATE
- run neo4j with docker-compose - neo4j not accessib
- How to create multiple nodes with cypher in neo4j
- Order by relationship properties neo4j
- How can I specify which relationship type to use a
相关文章
- Neo4j DATE Data Types
- How can I get the number of nodes of a Neo4j graph
- What is the fully qualified path of the Neo4j data
- Neo4j in Azure mobile services
- NoClassDefFoundError when executing a Neo4j Cypher
- java.lang.ClassNotFoundException Every time I chan
- Spring data neo4j aspectJ setup error
- which graphDB will perform best for this specific
With Neo4j web interface I just do copy&paste.
On the console I sometimes use curl to talk to Neo4j's REST interface. That allows me to use the same queries (with references to separate parameters) that I have in my application. You have to wrap the query in your file into a json object for that.
data.json:
command:
On Debian/Ubuntu or any *nix installations, use the following from terminal:
$
neo4j-shell -c < path-to-cypher-query-file.cql
Note that each cypher query in the file must end in a semicolon and must be separated by a blank line from the other query. Also, the
.cql
ending (file format) is not mandatory.Just add -file as a parameter when starting the console.
On windows, it would look like this :
Or you could also print the result into a new 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.
or using
cypher-shell
The neo4jShell.bat file has been removed since this question was asked. The new approach to execute cypher files is to use the web application called LazyWebCypher .
./bin/neo4j-shell -path ../data/databases/ -c < commands.cql
on Neo4j 3.2.1