Loading TOC...

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.
  

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