Loading TOC...

MarkLogic 10 Product Documentation
flexrep.doPull

flexrep.doPull(
   pull as element(flexrep.pull)
) as Sequence

Summary

This function is used by a Replica to pull updates from the Master. It returns a list of elements; the first element is the response element that was set back to the master, followed by one or more flexrep:ack elements that were posted back to the master.

Parameters
pull The pull replication configuration returned by the flexrep:pull-get function.

Example

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

    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 cfg = flexrep.configurationGet(domain, true);
  const domainId = flexrep.configurationGetId(cfg);

  const pull = flexrep.pullGet(domainId);

  flexrep.doPull(pull);
  // Returns the response and ACK elements last sent to the master.
   

Required Privileges

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

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