Loading TOC...


   domain-id as (Number|String),
   [with-targets as Boolean],
   [terse as Boolean]
) as element(flexrep.domainStatus)


This function returns the replication status for the specified replicated CPF domain.

domain-id The ID of the replicated domain.
with-targets Set to true to include status information for each target. Otherwise set to false.
terse Set to true to prevent counts from being returned for each of the individual states (deleted, error, updated, and so on). Otherwise set to false.


const flexrep = require('/MarkLogic/flexrep');

  // 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"));',
          'database' : xdmp.database('Triggers')
  const cfg = flexrep.configurationGet(domain, true);
  const targetId = flexrep.configurationTargetGetId(cfg, 'Replica');

  flexrep.domainStatus(domain, true, false);

  // Returns the status of the domain and its targets. 

Required Privileges


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