Export neo4j database in json file

泪湿孤枕 提交于 2019-12-20 23:28:17

问题


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


回答1:


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.




回答2:


Both using the api and the shell tools are good solutions. But they don't seem scalable, in a containerized environment it will be kind of difficult to automate this process.

The Geoff package is really great and there are tools as this in other languages too, if needed. The speed it reads and dumps the data made me more confident in this solution as opposed to the others.

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



来源:https://stackoverflow.com/questions/24608316/export-neo4j-database-in-json-file

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!