Neo4j Cypher update relationship

2017-12-07  本文已影响37人  kinkyboots

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

上一篇下一篇

猜你喜欢

热点阅读