neo4j cypher: how to change the type of a relationship

后端 未结 5 1805
粉色の甜心
粉色の甜心 2020-12-08 07:44

I can\'t find a way to change a relationship type in Cypher. Is this operation possible at all? If not: what\'s the best way achieve this result?

5条回答
  •  鱼传尺愫
    2020-12-08 08:33

    I use the following when modifying it.

    match (from:Label1 { prop: 1 })-[r:RELATIONSHIP]->(to:Label2 { prop: 2 })
    with from, r, to
    create (from)-[:NEW_RELATIONSHIP]->(to)
    with r
    delete r
    

提交回复
热议问题