Loading TOC...

flexrep.configurationInsert

flexrep.configurationInsert(
   $cfg as element(flexrep.configuration)
) as null

Summary

This function inserts a replication configuration to the database.

Parameters
$cfg The replication configuration.

Example

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.
  
   

Required Privileges

http://marklogic.com/xdmp/privileges/flexrep-admin

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