xdmp.invokeFunction( jsFunc as function(), [options as Object?] ) as ValueIterator
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.
|
http://marklogic.com/xdmp/privileges/xdmp-invoke
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}
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.