L.Leo
L.Leo

Reputation: 91

How to load external file when using LOAD CSV in neo4j?

I know that we can use

LOAD CSV WITH HEADERS FROM 'file:///nodes.csv' AS row

in Neo4j, but seems the default folder is import directory under current Neo4j DB. If the DB is under disk D, how can I load the csv file under disk E using LOAD CSV (on Windows)? I have tried 'file:///e:/XXX.csv', 'file:e:/xxx.csv'. None of them can works...

Upvotes: 3

Views: 589

Answers (1)

Luanne
Luanne

Reputation: 19373

You'll find a setting in neo4j.conf like this

# This setting constrains all `LOAD CSV` import files to be under the `import` directory. Remove or uncomment it to
# allow files to be loaded from anywhere in filesystem; this introduces possible security problems. See the `LOAD CSV`
# section of the manual for details.
dbms.directories.import=import

If you remove this/comment it, Neo4j should allow loading files from anywhere in the system

Upvotes: 5

Related Questions