Move/copy all relationships to different node

后端 未结 1 461
眼角桃花
眼角桃花 2020-12-16 05:24

Is there any way to copy or move a relationship from one node to another?

I have a situation similar to that here:

neo4j merge 2 or multiple duplicate nodes<

相关标签:
1条回答
  • 2020-12-16 05:56

    I think you can just chain these together:

    // get all relationships
    MATCH
      (a:Label1 { title : 'blah' })-[r]-(o),
      (d:Label1 { title : 'blah blah' })
    CREATE (d)-[r2:type(r)]-(o)
    DELETE r, a
    

    The only thing I'm not entirely sure about is the ability to use the type() function where it's being used there. I'll try it out now

    0 讨论(0)
提交回复
热议问题