MarkLogic Server 11.0 Product Documentation
alert.ruleSetUserId

alert.ruleSetUserId(
   rule as Object,
   user-id as (Number|String)
) as Object

Summary

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.

Example

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