Loading TOC...

MarkLogic 9 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

  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
  

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