Loading TOC...

MarkLogic 9 Product Documentation
trgr.propertyContent

trgr.propertyContent(
   property-name as xs.QName
) as element(trgr.propertyContent)

Summary

Returns the XML representation of a property part to a triggering event, usable as the content parameter of a trigger event constructor such as trgr.triggerDataEvent .

Parameters
property-name The QName of the property.

Usage Notes

Adding, changing or removing the $property-name document property matches this event part.

Example

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

trgr.triggerDataEvent(
  trgr.directoryScope('/myDir/', '1'),
  trgr.propertyContent(
    fn.QName(null, 'myInterestingProperty')),
  trgr.postCommit());

// A property modification trigger event that can
// be used to create a trigger which fires whenever 
// the property myInterestingProperty is added, modified
// or removed from a document in /myDir/.
   

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