neo4j cypher: how to change the type of a relationship

后端 未结 5 1807
粉色の甜心
粉色の甜心 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:16

    I would simply delete the relationship and create a new one:

    MATCH (a) - [r:OLD_RELATION] -> (b)
    DELETE r
    CREATE (a) - [:NEW_RELATION] -> (b)
    

提交回复
热议问题