For example, I want to delete Actor
node with id = "005A" and its connected Movie
nodes. The relationship between Actor and Movie node is ACTED_IN
.
I have tried this cypher query:
MATCH (a:Actor {id: "005A"})
OPTIONAL MATCH (a)-[r:ACTED_IN]->(m)
DELETE a, r, m;
but it didn't work, I got TransactionFailureException: Unable to commit transaction
error.
Anyone can give a solution?
UPDATE:
I found out that there is relationship from other node (Agency
) to Actor
node which labeled as OWNED
. So the diagram is like this:
(aa:Agency)-[o:OWNED]->(a:Actor)