Loading TOC...


   $name as xs:string,
   $domain-id as xs:unsignedLong,
   $target-id as xs:unsignedLong,
   $urls as xs:string+,
   $http-options as element(flexrep:http-options)?
) as element(flexrep:pull)


This function creates a configuration on a Replica database to pull updates from the Master database. If a configuration already exists for the given target and domain IDs, then the configuration is overwritten.

name The name of the pull configuration.
domain-id The ID of the domain containing the replicated content. This value is obtained from the Trigger database used by the Master database.
target-id The ID of the replication target. This value is obtained from the Master database.
urls The URL of the Master App Server.
http-options The HTTP options in XML format.


  (: This query must be executed on a Replica database. :)
  xquery version "1.0-ml"; 

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

  (: Specify the ID of the replicated CPF domain obtained from the Master's 
     Triggers database. :)
  let $domain:= 9535475951259984368

  (: Specify the ID of the replication target obtained from the Master database. :)
  let $target-id := 18130470845627037840

  (: Specify the HTTP options for the replication target. :)
  let $http-options := 
      <http:authentication xmlns:http="xdmp:http">
      <http:client-cert xmlns:http="xdmp:http"/>
      <http:client-key xmlns:http="xdmp:http"/>
      <http:pass-phrase xmlns:http="xdmp:http"/>

  let $pullconfig := flexrep:pull-create(

  (: Insert the pull configuration into the Replica database. :)
  return flexrep:pull-insert($pullconfig) 

  (: Creates a pull replication configuration element for the specified domain. :)

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