Loading TOC...

MarkLogic Server 11.0 Product Documentation
admin:database-foreign-replica-set-replication-enabled

admin:database-foreign-replica-set-replication-enabled(
   $foreign-replica as element(db:foreign-replica),
   $enabled as xs:boolean
) as element(db:foreign-replica)

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


  xquery version "1.0-ml";

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

  let $cfg := admin:get-configuration()
  let $old := admin:database-get-foreign-replicas($cfg, xdmp:database("Documents"))
  let $new := admin:database-foreign-replica-set-replication-enabled($old, fn:false())
  let $newcfg := admin:database-set-foreign-replicas($cfg, xdmp:database("Documents"), $new)
  return admin:save-configuration($newcfg)

  (: Sets the enabled flag for the foreign replica database
     configuration element. :)
    

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