All document-level operations can be intercepted via triggers. Bagri supports triggers which fire before or after create/update/delete operation on any document, synchronously or asynchronously. Triggers can be developed in XQuery and registered in schema via XQuery module or in Java and registered as Java extension library. When do we need them? Synchronous triggers before create/update are good fit for some custom document validation, throwing an exception from such trigger will prevent invalid document processing. Asynchronous triggers after create/update/delete can be used for some statistics collection, or any other additional processing, which does not impact system performance.
In a near future we’re planning introduce transaction-scope triggers which will fire before or after transaction begin/commit/rollback. Does anyone see a value in triggers fired before or after select (query)? Let’s discuss it on GitHub or in our Google Group.