如何构建此 XQuery 以在 CORB 作业中运行?使用匹配的候选 URI 处理每个文档的第二个模块不起作用。
URIS 模块
(:a module to select the candidate URIs to process:)
xquery version "1.0-ml";
declare variable $target-collection := "/activity";
declare variable $update-collection := "/activity/analytics-read-added"
let $uris := cts:uris( (),
(),
cts:and-query((
cts:collection-query($target-collection),
cts:not-query(cts:collection-query($update-collection))
))
)
return (count($uris), $uris)
工艺模块
(:a module to process each doc with a matching candidate URI:)
declare variable $URI as xs:string external;
xdmp:document-add-permission($URI,xdmp:permission("act-read-role","read")),
xdmp:document-add-collections($URI,$update-collection)