flexrep:configuration-create

flexrep:configuration-create(
   $domain-id as xs:unsignedLong,
   [$alerting-uri as xs:string?]
) as element(flexrep:configuration)

Summary

This function creates a new replication configuration element. The returned element must be subsequently inserted to the database with flexrep:configuration-insert. .

Parameters
domain-id The ID of the replicated domain.
alerting-uri The URI of the alerting configuration.

Example

  (: This query must be executed on the Master database. :)

  xquery version "1.0-ml"; 

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

  (: Obtain the ID of the replicated CPF domain from the Triggers database. :)
  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>)

   (: Create a replication configuration for the Replicated Content domain. :)
   let $cfg := flexrep:configuration-create($domain)

   (: Insert the replication configuration element into the database. :)
   return flexrep:configuration-insert($cfg) 

   (: Create a new replication configuration element for the Replication 
      Content domain and insert it into the Master database. :)
     
Powered by MarkLogic Server | Terms of Use | Privacy Policy