I have been trying to setup trigger to monitor any change in a node or a relation in my neo4j DB, also that updated node or relation data should be send as request body to an external POST api.
So far i have been able to make an POST api call on any change in db, also API endpoints are being called, but i want to put the trigger condition on a specific type of node or relation. also i am not able to get what data was updated and send it as request body. The neo4j’s apoc documentation are not very clear to me.
here’s structure of a very basic trigger which calls my POST api endpoint whenever any data change(insert, update, delete) happens in my db, and sends “testkey=testvalue”
CALL apoc.trigger.add(
'dbchangetrigger',
"CALL apoc.load.jsonParams('http://192.168.1.122:9500/api/trigger/triggerFromDb',{method: 'POST'},'testkey=testvalue')",
{phase: 'after'}
);
i want this trigger to happen when a particular type of node is updated and that updated data should be send to the api
Rahul Ranjan is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1