Hi I'm trying to execute a simple query like this:
START x = node(167966) MATCH x-[r?:RELATED_CONTENT]->content WHERE content.source='crawler' DELETE r, content
And I keep getting this weird and extremely unhelpful error message:
TransactionFailureException: Unable to commit transaction
Any ideas what causes this?
I've seen this before. Neo4j error messages are terrible. I'm guessing that the 'content' node you're trying to delete still has relationships, and you can't delete a node that is still connected to other nodes.
START x = node(167966) MATCH x-[r?:RELATED_CONTENT]->content WHERE content.source='crawler' WITH content MATCH content-[r?]-() DELETE r, content
That should delete all of the relationships to the content node and the node itself.
Awesome, that worked. Thanks!
They should really make a more specific error message for this like "TransactionFailureException: Unable to commit transaction because deleted node still has relationships."