trgr.triggerModule( database as xs.anyAtomicType, root as String, path as String ) as element(trgr.module)
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 .
|
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.
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().