Using LOAD CSV to import a local file to Neo4j in

2019-02-18 07:28发布

问题:

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?

回答1:

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