trgr.postCommit() as element(trgr.when)
Returns the XML representation of a post-commit trigger timing.
Use this function with
trgr.triggerDataEvent
to create a post-commit trigger event. To learn more about post-commit
triggers, see "Using Triggers to Spawn Actions" in the
Application Developer's Guide.
const trgr = require('/MarkLogic/triggers'); trgr.postCommit() trgr.triggerDataEvent( trgr.directoryScope('/myDir/', '1'), trgr.documentContent('create'), trgr.postCommit()); // A document modification trigger event that can // be used to create a trigger which fires whenever // a document is created in /myDir/. The associated // trigger module executes after committing the // firing document creation transaction.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.