I would like to ask if it is possible to have a trigger that is launched before every delete node transaction (for different types of nodes, I want to delete different relations and then the node) ?
Without this trigger the transaction fails because there are still relations (that I want to delete with trigger) linked to the node.
I don’t want to use detach delete so a user is forced to delete all children of the deleted node (to don’t keep any trash). But some of the children should be deleted automatically by the server (they are not visible to users). So, I tried to create an apoc trigger (using before phase) that should delete those “user invisible” children.
The problem is that neo4j executes the delete transaction before the trigger so the transaction fails because there are still some children linked to the node. Therefore, I would like to create a trigger that is executed before a delete transaction. In this case, it will delete all the “invisible” children and its relations and then execute the delete transaction. Thanks