Anusha R
Anusha R

Reputation: 11

I want to audit every change to nodes, relationships and attribute in Neo4j

In my project, we use python to connect to Neo4j and run the cypher queries. Are there any inbuilt auditing techniques with Neo4j? If not, could anyone please give suggestions on methods to achieve the same. I want to audit every single change to nodes, relationships and the attributes. Currently, we are thinking of querying Neo4j to know whether it is a create or update and get a list of attributes with new values. These values will later be inserted into a table in cassandra. This seems to be expensive to implement and messy. If anyone could point me towards a more elegant method, it would be greatly appreciated.

Thanks in Advance, Anusha

Upvotes: 1

Views: 384

Answers (1)

stdob--
stdob--

Reputation: 29147

You can try using triggers from the apoc library. For example:

CALL apoc.trigger.add(
  'auditCreateNodes',
  'UNWIND {createdNodes} AS n 
   ...audit actions...',
  {phase:'after'}
)

Upvotes: 1

Related Questions