使用此命令时
LOAD CSV FROM "file:///artists.csv" AS line
CREATE (:Artist { name: line.Name, year: toInt(line.Year)})
我到了
错误: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文件
"1","ABBA","1992"
"2","Roxette","1986"
"3","Europe","1979"
"4","The Cardigans","1992"
答案 0 :(得分:2)
您的CSV没有标题,因此您无法按名称访问列,即执行此操作时:line.Name
。
您必须按列索引执行:line[0]
干杯
答案 1 :(得分:0)
请尝试
从“ file:///artists.csv” AS行加载带有标题的CSV文件 创建(:艺术家{名称:line.Name,年份:toInt(line.Year)})
确保atists.csv文件中具有“名称”和“年份”列