cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Identity of impacted nodes/relationships following a write query

eric13013
Node Clone

I am using neo4j java client. When a write query is successful, I know it is possible to know how many nodes have been created, updated or deleted, and same for relationships via SummaryCounters. However, is there a way to know exactly which nodes and relationships have been created/updated/deleted ?

Thx.

3 REPLIES 3

You could use a serverside TransactionEventHandler. In it's afterCommit method you get a callback with exactly that information.
APOC Triggers (https://neo4j-contrib.github.io/neo4j-apoc-procedures/#_triggers) leverage exactly that functionality.

As far as I know, TransactionEventHandler is not available in neo4j-java-driver. I have to add neo4j-graph-api dependency. Is it correct ?

TransactionEventHandlers are a server-side concept - so that code should be a separate module from your client -side part.

See https://maxdemarzi.com/2015/03/25/triggers-in-neo4j/ for an example.