xdmp:invoke-function( $path as function() as item()*, [$options as (element()|map:map)?] ) as item()*
Returns the result of evaluating a function value.
Parameters | |
---|---|
path | A zero arity function value to execute. |
options |
The options node. The default value is (). The node must be in the
xdmp:eval namespace. See the
xdmp:eval section for a list of options.
|
http://marklogic.com/xdmp/privileges/xdmp-invoke
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.
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.