Created
June 3, 2015 14:59
-
-
Save ableasdale/7da8b16c51e3d25cf60c to your computer and use it in GitHub Desktop.
Get a list of all databases in a support dump and their ids
This file contains 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"; | |
declare namespace db = "http://marklogic.com/xdmp/database"; | |
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
declare variable $SUPPORT-DUMP-FILEPATH as xs:string := 'E:\support-request-go\support-request-go.txt'; | |
declare variable $support as document-node()* := xdmp:document-get( | |
$SUPPORT-DUMP-FILEPATH, | |
<options xmlns="xdmp:document-get"> | |
<format>xml</format> | |
<repair>full</repair> | |
</options> | |
); | |
element db-listing { | |
for $x in $support//db:databases/db:database | |
return element database { attribute id { $x/db:database-id}, $x/db:database-name/text() } | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment