MarkLogic Server 11.0 Product Documentation
trgr:collection-scope

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

Summary

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

Parameters
uri The collection 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:collection-scope("/myCollection/"),
  trgr:document-content("modify"),
  trgr:post-commit())

  => A collection modification trigger event 
     that can be used to create a trigger which fires
     whenever the /myCollection/ collection is modified.
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy