Neo4j Cypher update relationship

Suppose two node with a relationship. There is no direct way to 'update' a relationship, like 'rename'.
To update, use WITH

MATCH (n:User {name:"foo"})-[r:REL]->(m:User {name:"bar"})
CREATE (n)-[r2:NEWREL]->(m)
// copy properties, if necessary
SET r2 = r
WITH r
DELETE r

neo4j cypher: how to change the type of a relationship

你可能感兴趣的:(Neo4j Cypher update relationship)