The APOC call to export to JSON will fail if using Neo4j Browser, either the stand-alone desktop client or the web-browser-based client.
CALL apoc.export.json.all("file.json",{useTypes:true});
When this is run, you'll see the following error message:
Failed to invoke procedure `apoc.export.json.all`: Caused by: java.lang.RuntimeException: Export to files not enabled, please set apoc.export.file.enabled=true in your apoc.conf.
Otherwise, if you are running in a cloud environment without filesystem access, use the `{stream:true}` config and null as a 'file' parameter to stream the export back to your client.
Note that the stream mode cannot be used with the apoc.export.xls.* procedures.
Since Aura instances are managed instances, you don't have access to apoc.conf, so there is no way to edit this file to set apoc.export.file.enabled.
There are a couple of options to get streamed results in JSON.
- Export query results as a stream in the Neo4j Browser.
- Use the Apache HOP ETL tool to stream your results.
- Use Cypher shell to stream the results to a local file.
Streaming results in the Neo4j Browser:
Get the results as a stream and then export those results in Browser. Using the following syntax:
CALL apoc.export.json.all(null,{useTypes:true,stream:TRUE});
This will download the results as JSON (you can also choose CSV, as you can see in the screenshot).
You can use the Apache HOP ETL tool to stream your results.
You can read more about this option here.
The Cypher shell can stream the results to a local file using a standard redirect.
You can read more about this option in this KB document.
Comments
0 comments
Article is closed for comments.