MarkLogic Server 11.0 Product Documentation
trgr.directoryScope

trgr.directoryScope(
   uri as String,
   depth as String
) as element(trgr.directoryScope)

Summary

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

Parameters
uri The directory uri.
depth The depth of descendants included in the scope. ("1" or "infinity")

Example

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

trgr.triggerDataEvent(
  trgr.directoryScope('/myDir/', '1'),
  trgr.documentContent('modify'),
  trgr.postCommit());

// A directory modification trigger event that may
// be used to create a trigger which fires whenever
// the /myDir/ directory in a database is modified.
   
Powered by MarkLogic Server | Terms of Use | Privacy Policy