MarkLogic 9 Product Documentation
trgr:document-scope

trgr:document-scope(
   $uri as xs:string
) as element(trgr:document-scope)

Summary

Returns the XML representation of a document scope, usable as the scope parameter of a trigger event constructor such as trgr:trigger-data-event .

Parameters
uri The document uri.

Example

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

trgr:trigger-data-event(
  trgr:document-scope("/myDir/interesting.xml"),
  trgr:document-content("modify"),
  trgr:post-commit())

  => A collection modification trigger event that may
     be used to create a trigger which fires whenever the
     document with URI /myDir/interesting.xml is modified.
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy