Loading TOC...

admin:forest-delete-foreign-replicas

admin:forest-delete-foreign-replicas(
   $config as element(configuration),
   $forest-id as xs:unsignedLong,
   $foreign-replicas as element(as:foreign-replica)*
) as element(configuration)

Summary

This function deletes the foreign replica of the specified forest on the master host.

Parameters
config A configuration specification, typically as returned from one of the Admin module functions.
forest-id The ID of the replicated forest on the master host.
foreign-replicas The element returned by the admin:forest-get-foreign-replicas function that specifies the configuration for the replica forest. More than one forest replica configuration elements may be specified in a one-to-many replication scheme.

Required Privileges

This operation requires at least one of the following privileges:

http://marklogic.com/xdmp/privileges/admin/database

http://marklogic.com/xdmp/privileges/admin/database/{id}

http://marklogic.com/xdmp/privileges/admin/database/replication

http://marklogic.com/xdmp/privileges/admin/database/replication/{id}

Example


  xquery version "1.0-ml";

  import module namespace admin = "http://marklogic.com/xdmp/admin"
      at "/MarkLogic/admin.xqy";

  let $cfg := admin:get-configuration()
  let $freplica := admin:forest-get-foreign-replicas($cfg, xdmp:forest("Documents"))

  return admin:forest-delete-foreign-replicas($cfg, xdmp:forest("Documents"), $freplica)

  (: Returns a configuration element with the foreign replica forest, 'Documents',
     removed. Use admin:save-configuration to save the changes to the configuration
     or pass the configuration to other Admin API functions to make other changes. :)
    

Stack Overflow iconStack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.