Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Using LOAD CSV to import a local file to Neo4j in a Docker container

So I've been trying to import an external CSV file into my graphdb. My neo4j is stored in a Docker container. I placed the file in NEO_HOME/import, as implied. I called the LOAD CSV command with "file:///mycsv.csv" as an argument, and got the followng in return

Couldn't load the external resource at: file:/var/lib/neo4j/import/mycsv.csv

Since I'm running the Docker container on a Windows environment, I don't see where the /var directory should be. Even when browsing the container itself via the Docker Quickstart Terminal. I still cannot find /var/lib...

When trying to change the .conf file to a different import directory, it didn't help as well.

Did somebody have this before?

like image 933
izik Avatar asked Apr 25 '17 09:04

izik


1 Answers

You have to explicitly mount your import folder when invoking docker:

docker run -e NEO4J_AUTH=none -p 7474:7474 -p 7687:7687 -v $PWD/plugins:/plugins -v $PWD/import:/var/lib/neo4j/import neo4j:3.1.3-enterprise
like image 168
Stefan Armbruster Avatar answered Oct 02 '22 12:10

Stefan Armbruster