I\'m trying to copy all inward relationships of a node (n) to another node (m) (both of witch I know the ids) before deleting (n), but I c
(n)
(m)
assuming all incoming relationships are of same type say 'foo'. Then you could do the shorter following query:
START n=node(id1),m=node(id2) MATCH n<-[r:foo]-(p) WITH collect(p) as endNodes,m FOREACH(mm in endNodes | CREATE m-[:foo]->mm)
Which avoids the double foreach