Be the first to know! News, product information, and events delivered straight to your inbox.
Be the first to know! News, product information, and events delivered straight to your inbox.
Be the first to know! News, product information, and events delivered straight to your inbox.
Be the first to know! News, product information, and events delivered straight to your inbox.
Be the first to know! News, product information, and events delivered straight to your inbox.

xdmp:invoke-function( $func as function(), [$options as (element()|map:map)?] ) as item()*
Returns the result of evaluating an XQuery function value.
| Parameters | |
|---|---|
| $func | A zero arity function value to execute. |
| $options |
Options controlling the evaluation. The default is no options. For
detailed option information, see
xdmp:invoke
for detailed option information. NOTE: Some options require additional
privileges; for details, see the Required Privileges section of
xdmp:invoke.
When expressed as an element, the options node
must be in the xdmp:eval namespace.
|
http://marklogic.com/xdmp/privileges/xdmp-invoke
Some options require additional privileges. For details, see the Required Privileges for xdmp:invoke.
xdmp:invoke-function)
can only be used to invoke XQuery functions. The Server-Side JavaScript
version of this function (xdmp.invokeFunction) can only
be used to invoke JavaScript functions.
xquery version "1.0-ml";
let $content := <doc/>
return
xdmp:invoke-function(
function() { xdmp:document-insert("doc",$content) },
<options xmlns="xdmp:eval">
<transaction-mode>update-auto-commit</transaction-mode>
</options>)
(: Invokes the function value in an update-auto-commit transaction. :)
xquery version "1.0-ml";
let $content := <doc/>
return
xdmp:invoke-function(
function() { xdmp:document-insert("doc",$content), xdmp:commit() },
<options xmlns="xdmp:eval">
<transaction-mode>update</transaction-mode>
</options>)
(: Invokes the function value in a multi-statement update transaction. :)
Comments
The commenting feature on this page is enabled by a third party. Comments posted to this page are publicly visible.