
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}
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)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.