Reputation: 137
While using this command
LOAD CSV FROM "file:///artists.csv" AS line
CREATE (:Artist { name: line.Name, year: toInt(line.Year)})
I am getting
Error: Type mismatch: expected Any, Map, Node or Relationship but was List<String> (line 2, column 25 (offset: 68))
"CREATE (:Artist { name: line.Name, year: toInt(line.Year)})"
CSV file
"1","ABBA","1992"
"2","Roxette","1986"
"3","Europe","1979"
"4","The Cardigans","1992"
Upvotes: 2
Views: 969
Reputation: 61
Please try
LOAD CSV WITH HEADERS FROM "file:///artists.csv" AS line CREATE (:Artist { name: line.Name, year: toInt(line.Year)})
Make sure you have Name and Year columns in the atists.csv file
Upvotes: 3
Reputation: 7458
Your CSV has no header, so you can't access a column by its name, ie when you do this : line.Name
.
You have to do it by the column index : line[0]
Cheers
Upvotes: 3