Export neo4j database to json file

I want to export a Neo4j graphics database to a JSON file.

This is the JSON export button in the Neo4j web interface version, as shown in the attached figure below. enter image description here

But what is the equivalent command for the same task in the Neo4j shell.

thanks

+6
source share
2 answers

The browser-exported json is exactly what is sent to the transactional endpoint of cypher . It is not directly accessible through neo4j-shell , but you can use any http client console, such as cURL or httpie .

For httpie, it's simple:

  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 easy to extend neo4j-shell , see Michael neo4j-shell-tools .

+7
source

Both using api and shell tools are good solutions. But they do not seem scalable, in a container environment it will be difficult to automate this process.

The Geoff package is really great, and if necessary there are tools like in other languages. The speed that he reads and resets data has made me more confident in this decision, unlike others.

Later Edit: I noticed that you are looking for a specific Json Format, I found another cool library that can help with this pretty quickly if you need to.

0
source

Source: https://habr.com/ru/post/971858/


All Articles