Wie kann ich diese XQuery so erstellen, dass sie in einem CORB-Job ausgeführt wird? Das zweite Modul zum Verarbeiten jedes Dokuments mit einem passenden Kandidaten-URI funktioniert nicht.So richten Sie CORB ein
URIS Modul
(: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)
Prozessmodul
(: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)