Export neo4j database in json file

database, export, json, neo4j

Solution

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`.

Problem

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

Original source