
alert.makeRule( name as String, description as String, user-id as (Number|String), query as cts.query, action as String, options as Object ) as Object
This function creates the specified rule.
If the caller does not have the alert-admin
privilege then $user-id must be the ID
of the current user from the security database.
If $user-id is 0, it will be automatically
replaced with the current user's ID.
const alert = require("/MarkLogic/alert.xqy");
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"})
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.