2

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"

Aman Kumar
  • 137
  • 1
  • 1
  • 8

2 Answers2

2

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

logisima
  • 7,340
  • 1
  • 18
  • 31
2

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