I want to export Neo4j graph database in JSON file.
This is a Export JSON button in Neo4j web UI version as shown in attached image below.
But what is the equivalent command for the same task in Neo4j shell.
Thanks
Importing JSON Data into Neo4jThere are a plethora of JSON-based Web APIs that we can import into Neo4j, and we can use one of the Load JSON procedures to retrieve data from these APIs and turn it into map values ready for Cypher to consume.
To export package JSON first open a package, find the Import/Export dropdown and press the Export button. After that, the browser will start a download. The exported JSON file is formatted so it will be easy to track the difference between such files.
You can already export CSV from the Neo4j Browser by clicking the download icon on the table view of your Cypher query results. Alternatively, you can also use my neo4j-shell-tools to export results of a Cypher query to a CSV file.
The json
exported by the browser is exactly what is getting sent to the transactional cypher endpoint. This is not directly accessible via neo4j-shell
, but you might use any command line http
client like cURL
or httpie
.
For httpie it's as simple as:
http -b -j localhost:7474/db/data/transaction/commit statements:='[{"statement": "<your cypher goes here>", "parameters": { cypher parameters go here as map }]'
However it is simple to extend neo4j-shell
, see Michael's neo4j-shell-tools
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With