0

I've just installed cypher-shell.

I'm trying to perform bellow command:

LOAD CSV FROM 'https://data.neo4j.com/northwind/customers.csv';

I'm getting:

Invalid input ';': expected
  "!="
  "%"
  "*"
  "+"
  "-"
  "."
  "/"
  ":"
  "<"
  "<="
  "<>"
  "="
  "=~"
  ">"
  ">="
  "AND"
  "AS"
  "CONTAINS"
  "ENDS"
  "IN"
  "IS"
  "OR"
  "STARTS"
  "XOR"
  "["
  "^" (line 2, column 63 (offset: 63))
"LOAD CSV FROM 'https://data.neo4j.com/northwind/customers.csv';"

I'm running neo4j using oficiak docker image:

docker container run -d --rm --name neo4j -p 7474:7474 -p 7687:7687 neo4j

Any ideas?

Jordi
  • 20,868
  • 39
  • 149
  • 333

1 Answers1

1

Load CSV looks for the file in the Neo4j Import directory. You need to move the csv to that directory and then your query would look like this if the file contains a customer ID:

LOAD CSV WITH HEADERS FROM 'file:///customers.csv' AS line FIELDTERMINATOR ',' merge (c:customer{ID:toInteger(line.ID)}) 

The latter portion of the query tells Neo4j what to do with the data which is referenced use line and typed using toInteger(), toString(), etc.

David A Stumpf
  • 753
  • 5
  • 13