Loading TOC...

MarkLogic Server 11.0 Product Documentation
trgr.triggerModule

trgr.triggerModule(
   database as xs.anyAtomicType,
   root as String,
   path as String
) as element(trgr.module)

Summary

Returns the XML representation of a trigger module which can be used as the module parameter of trgr.createTrigger .

Parameters
database A database-id (all digits) or database name.
root The root path within the database.
path The path to the module relative to $root within the database identified by $database-id.

Usage Notes

Note: A database name which is the same as a database ID will be treated as an ID. Do not use a database ID as database name.

Example

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

trgr.triggerModule(
  xdmp.database('Documents'), 
  '/modules/', 
  'logCreate.xml');

// An internal XML representation of the trigger module,
// usable as the module parameter of trgr.createTrigger().

trgr.triggerModule(
  'Documents',
  '/modules/',
  'logCreate.xml');

// An internal XML representation of the trigger module,
// usable as the module parameter of trgr.createTrigger().
   

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