Created
October 10, 2019 18:49
-
-
Save prestonmcgowan/1c3b1138c84cac8add80b1edbc77fd0c to your computer and use it in GitHub Desktop.
Patch MarkLogic Modules File
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 $uri := '/ext/lib/my-search-lib.xqy' | |
let $filename := "/var/opt/MarkLogic/Temp/my-search-lib.xqy" | |
let $code := xdmp:document-get($filename) | |
(: Uncomment the next line to verify the file is able to be read | |
return $code | |
:) | |
(: Using node-replace instead of insert-document causes all permissions and collections to be maintained. :) | |
return xdmp:node-replace(fn:doc($uri)/text(), text{ $code } ) | |
; | |
(: Verify :) | |
let $uri := "/ext/lib/my-search-lib.xqy" | |
return fn:doc($uri) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment