admin.databaseForeignReplicaSetReplicationEnabled( foreign-replica as element(db.foreignReplica), enabled as Boolean ) as element(db.foreignReplica)
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. |
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}
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. :)