Loading TOC...

xdmp.invokeFunction

xdmp.invokeFunction(
   $jsFunc as function(),
   [$options as Object?]
) as ValueIterator

Summary

Returns the result of evaluating a function value.

Parameters
$jsFunc A zero arity function value to execute.
$options The options object. The default value is (). See the xdmp.eval section for a list of options.

Required Privileges

http://marklogic.com/xdmp/privileges/xdmp-invoke

Example

  function test29197(uri,doc) {
    return {
      setUri: function setUri(_uri) { uri = _uri; },
      setDoc: function setDoc(_doc) { doc = _doc; },
      insert: function docInsert() { xdmp.documentInsert(uri,doc); }
    };
  };
  var testInvoke = test29197("29197.json",{a:1});
  xdmp.invokeFunction(testInvoke.insert,
    {transactionMode:"update-auto-commit"});
  xdmp.eval("cts.doc('29197.json')");

  => Insert a doc and then retrieve it. Returns:
     {"a":1}
  

Comments

    Powered by MarkLogic Server 7.0-4.1 and rundmc | Terms of Use | Privacy Policy