alert.ruleRemove( config-uri as String, id as (Number|String) ) as null
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. |
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);