Created
July 1, 2013 10:56
-
-
Save ableasdale/5899947 to your computer and use it in GitHub Desktop.
Extract a sequence of forest ids local to a given host
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"; | |
declare namespace fs="http://marklogic.com/xdmp/status/forest"; | |
declare variable $DATABASE as xs:string := "YOUR-DATABASE-HERE"; | |
declare function local:get-host-forest-ids() as xs:unsignedLong+ { | |
for $f in xdmp:database-forests(xdmp:database($DATABASE)) | |
where xdmp:forest-status($f)/fs:host-id eq xdmp:host() | |
return | |
$f | |
}; | |
local:get-host-forest-ids() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment