Loading TOC...

trgr:pre-commit

trgr:pre-commit() as element(trgr:when)

Summary

Returns the XML representation of a pre-commit trigger timing.

Usage Notes

Use this function with trgr:trigger-data-event to create a pre-commit trigger event. To learn more about pre-commit triggers, see "Using Triggers to Spawn Actions" in the Application Developer's Guide.

Example

xquery version "1.0-ml";
import module namespace trgr="http://marklogic.com/xdmp/triggers" 
   at "/MarkLogic/triggers.xqy";

trgr:post-commit())
  trgr:trigger-data-event(
    trgr:directory-scope("/myDir/", "1"),
    trgr:document-content("create"),
    trgr:pre-commit())

  => 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 before committing the 
     firing document creation transaction.
  

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.