MarkLogic 12 EA 1 Product Documentation
admin.forestDeleteForeignReplicas

admin.forestDeleteForeignReplicas(
   config as element(configuration),
   forest-id as (Number|String),
   foreign-replicas as element(as.foreignReplica)[]
) 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

  
  const admin = require('/MarkLogic/admin.xqy');
  const cfg = admin.getConfiguration()
  const freplica = admin.forestGetForeignReplicas(cfg, xdmp.forest("Documents"))
  admin.forestDeleteForeignReplicas(cfg, xdmp.forest("Documents"), freplica)

   //Returns a configuration element with the foreign replica forest, 'Documents',
   //removed. Use admin.saveConfiguration to save the changes to the configuration
   //or pass the configuration to other Admin API functions to make other changes. 
    
Powered by MarkLogic Server | Terms of Use | Privacy Policy