
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)
This function processes one or more replicated updates for the specified domain ID, ordered by oldest changes first, and returns the results.
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.