neo4j cypher: how to change the type of a relationship

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

    The answer from Michael Hunger is correct but it still need with in this cypher query. WITH can be used when you want to switch different operation in one cypher query. http://docs.neo4j.org/chunked/stable/query-with.html

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

提交回复
热议问题