alert.ruleInsert( config-uri as String, rule as Object ) as null
This function inserts rule into the database associated with the specified alerting configuration. A user must have the alert-user privilege to call this function.
Parameters | |
---|---|
config-uri | The URI passed
to
alert.makeConfig .
|
rule | The representation of a rule. |
const alert = require("/MarkLogic/alert.xqy"); declareUpdate(); alert.ruleInsert( "http://acme.com/alert/message-board", alert.makeRule( "nucleic acids email", "Alert me to anything concerning nucleic acids", "0", cts.orQuery([ cts.wordQuery("dna"), cts.wordQuery("rna")]), "sms", {"emailAddress":"me@somedomain.com"}))