Sorry.. this should be easy but, I got stuck..
Let's say I have a chain of nodes in my graph. I want to delete (detach) all the relationships with a given state from nodeA all the way to nodeZ. I want to keep the nodes but after a given pathway has been completed in my graph, I no longer want it. Some relationships in a thread of locations are Pending and some Completed. Once the entire chain has been Completed I want to disconnect all the completed relationship in that thread. Keep the locations but disconnect the threads that have been completed.
I would need more specific details to provide an actual query, but here is an example of deleting relationships along a path based on some relationship property.
match path=(n:Node{id:0})-[:HAS_REL*]->(m:Node)
where not exists ( (m)-[:HAS_REL]->(:Node) )
with [i in relationships(path) where i.status = 'complete'] as completedRelationships
forEach(rel in completedRelationships |
delete rel
)
Before:
After:
1 Like
Thank you sir.. AGAIN.. thanks man for helping me.. thanks man
1 Like