Apologies if this is a simple/newbie question - I've looked everywhere and cannot find an answer.
I would like to duplicate all the relationships that one node has, to another.
So for example, using the classic movie graph:
(mail:Movie{name:"You've Got Mail"})<-[:ActedIn{year:1998})]-(tom:Actor{name:"Tom Hanks"})<-[:Directed]-(nora:Director{name:"Nora Ephron"})
I'd like to be able to duplicate those relationships so that (meg:Actor{name:"Meg Ryan"}) is also connected to nora and mail with exact copies of those relationships - types and properties included.
Considerations:
- the relationships that Tom has are both incoming and outgoing
- Meg a is pre-existing Node - I'm not trying to create that ite in this query
- My real graph has many different relationship types, so for all intents and purposes, the code needs to be able to treat the relationship type as arbitrary input
I figure there is some combination of FOREACH and apoc's create.relationship() procedure but i cannot figure it out!
Any help gratefully received. this can't be something that's never come up before!
Thanks