MarkLogic Server 11.0 Product Documentation
alert.ruleInsert

alert.ruleInsert(
   config-uri as String,
   rule as Object
) as null

Summary

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.

Example

  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"}))
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy