Created
July 2, 2017 15:54
-
-
Save ableasdale/1623c4f1b2d29afca099afe4dd134f02 to your computer and use it in GitHub Desktop.
MarkLogic: Simple Forest Creation
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"; | |
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; | |
declare variable $PATH as xs:string := "/tmp"; | |
declare variable $NUMBER-OF-FORESTS as xs:integer := 4; | |
declare variable $FOREST-NAME as xs:string := "example-forest"; | |
declare variable $CONFIG := admin:get-configuration(); | |
for $i in 1 to $NUMBER-OF-FORESTS | |
let $CONFIG := admin:forest-create($CONFIG, $FOREST-NAME||"-"||$i, xdmp:host(), $PATH) | |
return admin:save-configuration($CONFIG) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment