i have a node (a) , i want to create new node (c) and relate it to all nodes related to (a) with the same old relationships (a) related to other nodes in the graph??
i tried the following cypher :
MATCH (a)-[r]-(b) where ID(a)= 42
WITH COLLECT(r) AS rels, a, b
create (c) set c.name='علامات'
FOREACH (rel in rels |
CREATE (b)-[r:LINKED_TO]->(c)
SET r+=rel
)
but it created multiple (c) nodes not just one.
i tried the cypher below but it created multiple (c) nodes with new relations not only one node.
MATCH (a)-[r]-(b) where ID(a)= 42
WITH COLLECT(r) AS rels, a, b
create (c) set c.name='علامات'
FOREACH (rel in rels |
CREATE (b)-[r:LINKED_TO]->(c)
SET r+=rel
)