alert.ruleSetUserId( rule as Object, user-id as (Number|String) ) as Object
This function returns the rule with the user ID
updated. If the caller does not have the
alert-config
privilege, an exception will be
thrown if the caller attempts to save a rule for a user other
than himself.
Parameters | |
---|---|
rule | The representation of a rule. |
user-id | The user ID value to set for the given rule. |
var alert = require("/MarkLogic/alert.xqy"); alert.ruleSetUserId( alert.getAllRules("http://acme.com/alert/message-board", cts.wordQuery("dna"))[0], "7071164303237443533") => Returns the JSON representation of the rule with the new user ID updated to 7071164303237443533