Skip to content

Instantly share code, notes, and snippets.

@ableasdale
Created May 26, 2020 08:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ableasdale/20af41c0e45896a2dfdbd6b9f32d40e5 to your computer and use it in GitHub Desktop.
Save ableasdale/20af41c0e45896a2dfdbd6b9f32d40e5 to your computer and use it in GitHub Desktop.
MarkLogic: Removing multiple replica forests from their respective master forests
xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy";
declare variable $CONFIG := admin:get-configuration();
let $CONFIG := admin:forest-remove-replica($CONFIG, xdmp:forest("Documents"), xdmp:forest("Documents-R"))
let $CONFIG := admin:forest-remove-replica($CONFIG, xdmp:forest("Extensions"), xdmp:forest("Extensions-R"))
return admin:save-configuration($CONFIG)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment