Loading TOC...

flexrep.process

flexrep.process(
   domain-id as (Number|String),
   [size as Number?],
   [targets as (Number|String)[]],
   [forest-ids as (Number|String)[]],
   [uris as String[]]
) as element(flexrep.results)

Summary

This function processes one or more replicated updates for the specified domain ID, ordered by oldest changes first, and returns the results.

Parameters
domain-id The ID of the replicated domain.
size The maximum number of replications. If not specified, the maximum is one.
targets The IDs of the replication targets.
forest-ids The forest IDs from which to process replications. If none are specified, replications from all forests are considered.
uris The URIs of specific documents to process.

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("Replicated Content").xpath("//dom:domain-id"));',
       null,
         {
          'database' : xdmp.database('Triggers')
         });

  flexrep.process(domain); 

  // Processes the replicated updates for the "Replicated Content" domain.
     
   

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