Is there any method to set a property to relationships between those two nodes?
(I need to invert those edges).
The nodes in orange boxes have distinctive properties.
(The path can be of a different length, this is just an example).
Is there any method to set a property to relationships between those two nodes?
(I need to invert those edges).
The nodes in orange boxes have distinctive properties.
(The path can be of a different length, this is just an example).
You could experiment with the following. It will find the directed path between to specified nodes, and reverse the relationships between each set of nodes. You will need to change the node labels and relationship type, and the criteria for the 'n' and 'm' nodes.
match (n:Client) where id(n) = 0
match (m:Client) where id(m) = 3
match p = (n)-[*]->(m)
unwind relationships(p) as relationship
with startNode(relationship) as start, endNode(relationship) as end, properties(relationship) as prop, relationship
create (end)-[r:REL]->(start)
set r = prop
delete relationship
Hello @marcelix161
You can use the APOC function apoc.refractor.invert() to reverse the direction of the relationship.
MATCH ()-[r:MINST2]->()
CALL apoc.refactor.invert(r)
Regards,
Cobra