trgr.directoryScope( uri as String, depth as String ) as element(trgr.directoryScope)
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") |
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.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.