0
LOAD CSV WITH HEADERS FROM 
'file:///epl_mataches.csv' as row 
MATCH (c1:Club {name:row.`Team1`}), (c2:Club {name:row.`Team2`})
CREATE UNIQUE (c1) -[f:FEATURED{
    round:toInteger(row.Round),
    date:row.Date,
    homeTeamFTScore: toInteger(split(row.FT,"-" [0])),
    awayTeamFTScore: toInteger(split(row.FT,"-" [1])),
    homeTeamHTScore: toInteger(split(row.HT,"-" [0])),
    awayTeamHTScore: toInteger(split(row.HT,"-" [1]))
}] -> (c2)

我收到错误说明无效输入“唯一”:预期“(”,“allShortestPaths”或“最短路径”(第4行,第8列(偏移量:135))“创建唯一(c1)-[f:FEATURED {”

4

1 回答 1

0

CREATE UNIQUE声明已被弃用。要完成相同的功能,您可以使用该MERGE语句。

LOAD CSV WITH HEADERS FROM 
'file:///epl_mataches.csv' as row 
MATCH (c1:Club {name:row.`Team1`}), (c2:Club {name:row.`Team2`})
MERGE (c1) -[f:FEATURED{
    round:toInteger(row.Round),
    date:row.Date,
    homeTeamFTScore: toInteger(split(row.FT,"-" [0])),
    awayTeamFTScore: toInteger(split(row.FT,"-" [1])),
    homeTeamHTScore: toInteger(split(row.HT,"-" [0])),
    awayTeamHTScore: toInteger(split(row.HT,"-" [1]))
}] -> (c2)
于 2022-03-01T18:34:41.817 回答