Created
October 13, 2016 13:07
-
-
Save ableasdale/07e0115346d216464a3e93258c4fe5d8 to your computer and use it in GitHub Desktop.
Simple Document move example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
xquery version "1.0-ml"; | |
for $i in cts:uris ( | |
(), | |
("limit=10000"), | |
cts:not-query(cts:collection-query("moved")) | |
) | |
let $document := fn:doc($i) | |
return | |
(xdmp:document-add-collections($i, "moved"), | |
xdmp:spawn-function(function() {xdmp:document-insert($i, $document), xdmp:commit()}, | |
<options xmlns="xdmp:eval"> | |
<database>{xdmp:database("%YOUR_TARGET_DATABASE_HERE%")}</database> | |
<transaction-mode>update</transaction-mode> | |
</options>)) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment