Skip to content

Instantly share code, notes, and snippets.

@ableasdale
Created May 26, 2016 16:13
Show Gist options
  • Save ableasdale/25dfc14a497e70a8c5c834885e855dbd to your computer and use it in GitHub Desktop.
Save ableasdale/25dfc14a497e70a8c5c834885e855dbd to your computer and use it in GitHub Desktop.
Gets an ordered list of forests for a given database
xquery version "1.0-ml";
(: Returns a list of forests in order for a given database :)
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy";
let $config := admin:get-configuration()
let $dbid := admin:database-get-id($config, "test-db")
return admin:database-get-attached-forests($config,$dbid) ! xdmp:forest-name(.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment