'How to solve error about neo4j :Invalid input 'UNIQUE': expected "(", "allShortestPaths"

I try to execute this comnands, but screen show the message: How to solve this problems?

Invalid input 'UNIQUE': expected "(", "allShortestPaths" or "shortestPath" (line 4, column 8 (offset: 269)) "CREATE UNIQUE(s1)<-[:FROM]->(r)"

initial input comnand:

:auto USING PERIODIC COMMIT 500 load csv with headers from "https://lovecandyhsu.neocities.org/relations.csv" as csvLine MATCH (s1:Station { id: toInteger(csvLine.fromId)}),(r:Route { id: toInt(csvLine.route_informationId)}),(s2:Station { id: toInt(csvLine.toId)}) CREATE UNIQUE(s1)<-[:FROM]->(r) CREATE UNIQUE(r)<-[:TO]->(s2) RETURN csvLine


Solution 1:[1]

The 'CREATE UNIQUE' clause was deprecated in Neo4j version 3.2

The MERGE caluse does the trick now.

Ideally, you should be good to go just by replacing 'CREATE UNIQUE' with 'MERGE'.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Thennan