flexrep.configurationInsert( cfg as element(flexrep.configuration) ) as null
This function inserts a replication configuration to the database.
Parameters | |
---|---|
cfg | The replication configuration. |
const flexrep = require('/MarkLogic/flexrep'); declareUpdate(); // Obtain the domain ID from the database used by the Master to enable CPF. const domain = xdmp.eval( 'const dom = require("/MarkLogic/cpf/domains");' + 'fn.data(dom.get("Default Master").xpath("//dom:domain-id"));', null, { 'database' : xdmp.database('Triggers') }); const config = flexrep.configurationGet(domain, true); const targetId = flexrep.configurationTargetGetId(config, 'Replica'); const cfg = flexrep.configurationTargetSetEnabled( config, targetId, false); flexrep.configurationInsert(cfg); // Disables push replication on the Master database.
http://marklogic.com/xdmp/privileges/flexrep-admin
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.