MarkLogic 12 EA 1 Product Documentation
admin.databaseForeignReplicaSetReplicationEnabled

admin.databaseForeignReplicaSetReplicationEnabled(
   foreign-replica as element(db.foreignReplica),
   enabled as Boolean
) as element(db.foreignReplica)

Summary

This function sets the enabled flag on a replica database configuration.

Parameters
foreign-replica The configuration element for the foreign replica database.
enabled The enabled flag.

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


  let admin = require("/MarkLogic/admin.xqy")
  let cfg = admin.getConfiguration()
  let old = admin.databaseGetForeignReplicas(cfg, xdmp.database("Documents"))
  let newc = admin.databaseForeignReplicaSetReplicationEnabled(fn.head(old), false)
  let newcfg = admin.databaseSetForeignReplicas(cfg, xdmp.database("Documents"), fn.head(newc))
  admin.saveConfiguration(newcfg)
    
Powered by MarkLogic Server | Terms of Use | Privacy Policy