cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

CALL apoc.export.csv.query. Where the exported file is located

Hello, i have the following problem
I have spring boot application which is running in docker along with neo4j image.
In database i have 10mln records and i want export it to csv file but i don't know where the exported file is located or how i can set path where it should be exported.
I use apoc.export.csv.query as below

CALL apoc.export.csv.query("MATCH (n:Rating) RETURN n", "ratings.csv", {})

Im starting application and all services through docker-compose.yaml file

path for import in volumes works fine but for export i cant set in this way.

Where is the exported file ratings.csv?

5 REPLIES 5

Surprisingly the export functions by default write to the import folder, see https://neo4j.com/docs/labs/apoc/current/export/.

2X_a_accd92d1d0084935c20badada63ae7800b826eb2.png

I added this line with dbms.directiories.import=import.

I have the following settings and that does not work still.

The exported file is not in this directory

Your volume shouldn't be mounted to /import but instead to /var/lib/neo4j/import - I've just verified that the exported file does end up there.

I did as you ordered but it didn't help
This volume for import works good but the second does not

2X_3_38d80821e86c31280fe21f089edbec2d12da2610.png

I've used that command to start a container. Once it's up and I do an export I see the csv file produced in the mounted import folder:

docker run --rm \
--name neo4j \
-e NEO4J_AUTH=neo4j/123 \
-e NEO4J_ACCEPT_LICENSE_AGREEMENT=yes \
-e NEO4J_apoc_import_file_enabled=true \
-e NEO4J_apoc_export_file_enabled=true \
-e NEO4J_apoc_import_file_use__neo4j__config=true \
-e NEO4J_dbms_security_procedures_unrestricted=apoc.\\\*,algo.\\\* \
-e NEO4J_dbms_backup_address=0.0.0.0:6362 \
-e NEO4JLABS_PLUGINS=\[\"apoc\"\] \
-v $PWD/data:/data \
-p 7474:7474 \
-p 7687:7687 \
-p 6362:6362 \
-v $PWD/import:/var/lib/neo4j/import \
--user=$(id -u):$(id -g) \
neo4j:3.5.13-enterprise