Loading TOC...

MarkLogic 9 Product Documentation
trgr.collectionScope

trgr.collectionScope(
   uri as String
) as element(trgr.collectionScope)

Summary

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

Parameters
uri The collection uri.

Example

const trgr = require('/MarkLogic/triggers');

trgr.triggerDataEvent(
  trgr.collectionScope('/myCollection/'),
  trgr.documentContent('modify'),
  trgr.postCommit());

// 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.