Loading TOC...

alert.ruleRemove

alert.ruleRemove(
   config-uri as String,
   id as (Number|String)
) as null

Summary

This function removes the specified rule from the collection. A user must have the alert-user privilege to call this function. An exception is thrown if the rule does not exist. A user must have the alert-admin privilege to delete other users' rules.

Parameters
config-uri The URI passed to alert.makeConfig.
id The ID of the rule to be removed.

Example

  const alert = require("/MarkLogic/alert.xqy");

  declareUpdate();
  const id = alert.ruleGetId(
        alert.getAllRules("http://acme.com/alert/message-board", cts.wordQuery("dna"))[0]);
  alert.ruleRemove("http://acme.com/alert/message-board", id);
    

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