Showing results for 
Search instead for 
Did you mean: 

Head's Up! Site migration is underway. Pause, resolving how to handle anonymous content

Using triggers with custom procedures

Node Link

I want to use triggers to track changes in the database and once the trigger is fired I want to call a custom procedure. From the trigger I can pass the transactionId to the procedure. How can I get the transaction metadata in the custom procedure from the transaction Id? Is there any way to fetch the transaction metadata within the user procedure?

CALL apoc.trigger.add('my-trigger',
UNWIND apoc.trigger.nodesByLabel($assignedLabels, "Person") AS node
CALL my.change.log(labels(node), node, "name", $transactionId)
RETURN count(*)
, {phase:'after'})

Please provide the following information if you ran into a more serious issue:

  • neo4j version - 4.1.1, desktop version = 1.2.7
    Libraries used

Just sent an PR, see
This should be part of next apoc release for 4.1.