Reputation: 11
I'm using following query to delete all the nodes and relations:
START a=node(2)
MATCH (a)-[r:PUBLISHED_BY]->(c),
(b)-[s:PUBLISHED_UNDER]->(c)
DELETE r,s,c;
but I'm getting the following error message.
==> TransactionFailureException: Unable to commit transaction
Please help me where I'm doing wrong.
Upvotes: 0
Views: 160
Reputation: 33175
You have to delete all relationships when you delete nodes. Try this one.
MATCH (a)-[:PUBLISHED_BY]->(c)
WHERE id(a) = 2
OPTIONAL MATCH (c)-[r]-()
DELETE c, r;
Upvotes: 4