Created
October 10, 2019 16:23
-
-
Save prestonmcgowan/b39f852db105835e12918501c4d7c93b to your computer and use it in GitHub Desktop.
Copy documents between two MarkLogic module databases (or any two MarkLogic databases really)
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"; | |
let $ui-uris := cts:uri-match("/lib/*", "document") | |
for $u in $ui-uris | |
return | |
xdmp:eval(' | |
declare variable $u external; | |
declare variable $d external; | |
declare variable $p := ( xdmp:permission("rest-extension-user", "execute"), xdmp:permission("rest-admin", "update"), xdmp:permission("rest-admin", "read"), xdmp:permission("ui-role", "update"), xdmp:permission("ui-role", "read"), xdmp:permission("ui-role", "execute") ); | |
xdmp:document-insert($u, $d, $p) | |
', | |
( | |
xs:QName("u"), $u, | |
xs:QName("d"), fn:doc($u) | |
) | |
, | |
<options xmlns="xdmp:eval"> | |
<database>{xdmp:database("ui-modules--refactoring")}</database> | |
</options> | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment