简体   繁体   中英

Neo4j Loading CSV file

I trying to upload CSV to Neo4j Desktop (Version 3.3.5 Enterprise). Here is my code:

LOAD CSV WITH HEADERS FROM "file///:C:/Users/dr-gouda/.Neo4jDesktop/neo4jDatabases/database-22e2ad52-6882-472b-abc6-6c1594e733f2/installation-3.3.5/import/test.csv" as types 
create (a1:Type {Label: types.Label, Name: types.Name, Age: types.Age})

I got this message as an error:

Neo.ClientError.Statement.ExternalResourceFailed: Invalid URL 'file///:C:/Users/dr-gouda/.Neo4jDesktop/neo4jDatabases/database-22e2ad52-6882-472b-abc6-6c1594e733f2/installation-3.3.5/import/test.csv': no protocol: file///:C:/Users/dr-gouda/.Neo4jDesktop/neo4jDatabases/database-22e2ad52-6882-472b-abc6-6c1594e733f2/installation-3.3.5/import/test.csv

What is going on and what can I do?

Files for import are relative to the import directory for the db in question (otherwise a user using a load query to supply a file path to a sensitive file, which would be a huge security problem).

Since you already have the file there, use the relative path ... FROM "file:///test.csv" ...

Also, the : was in the wrong place.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM