MarkLogic 9 Product Documentation
flexrep:process

flexrep:process(
   $domain-id as xs:unsignedLong,
   [$size as xs:unsignedInt?],
   [$targets as xs:unsignedLong*],
   [$forest-ids as xs:unsignedLong*],
   [$uris as xs: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

  xquery version "1.0-ml"; 

  import module namespace flexrep = "http://marklogic.com/xdmp/flexible-replication" 
      at "/MarkLogic/flexrep.xqy";

  (: Obtain the domain ID from the database used by the Master to enable CPF. :)
  let $domain := xdmp:eval(
        'xquery version "1.0-ml";
         import module namespace dom = "http://marklogic.com/cpf/domains" 
		  at "/MarkLogic/cpf/domains.xqy";
         fn:data(dom:get( "Replicated Content" )//dom:domain-id)',
         (),
         <options xmlns="xdmp:eval">
            <database>{xdmp:database("MyTriggers")}</database>
         </options>)

  return flexrep:process($domain) 

  (: Processes the replicated updates for the "Replicated Content" domain. :)
     
Powered by MarkLogic Server | Terms of Use | Privacy Policy