op:doc-col-types() as item()+
Provides the 3rd parameter for op:from-param for row column types.
xquery version "1.0-ml"; import module namespace op="http://marklogic.com/optic" at "/MarkLogic/optic.xqy"; declare option xdmp:update "true"; let $permissions := (map:entry("roleName","rest-reader")=>map:with("capability","read"), map:entry("roleName","rest-writer")=>map:with("capability","update")) let $rows := ( map:entry("uri", '/optic/update/execute1.xml') =>map:with("doc", <doc>execute1</doc>) =>map:with("collections", ("execute", "write")) =>map:with("metadata", map:entry("time", "2022-10-13T11:00:0")) =>map:with("permissions", $permissions) =>map:with("quality", 1), map:entry("uri", '/optic/update/execute2.xml') =>map:with("doc", <doc>execute2</doc>) =>map:with("collections", ("execute", "write")) =>map:with("metadata", map:entry("time", "2022-10-13T11:00:0")) =>map:with("permissions", $permissions) =>map:with("quality", 2) ) return op:from-param("bindingParam", (), op:doc-col-types()) =>op:write() =>op:execute(map:entry("bindingParam",$rows))
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.