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)

I am getting error stating Invalid input 'UNIQUE': expected "(", "allShortestPaths" or "shortestPath" (line 4, column 8 (offset: 135)) "CREATE UNIQUE (c1) -[f:FEATURED{"

1 Answers1

1

The CREATE UNIQUE statement has been deprecated. To accomplish the same functionality you can use the MERGE statement.

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)
Tomaž Bratanič
  • 6,319
  • 2
  • 18
  • 31