
admin:database-foreign-replica( $foreign-cluster-id as xs:unsignedLong, $foreign-database-id as xs:unsignedLong, $connect-forests-by-name as xs:boolean, $lag-limit as xs:unsignedInt, [$replication-enabled as xs:boolean], [$queue-size as xs:unsignedInt] ) as element(db:foreign-replica)
  This function returns a replica database configuration.  Use the output of
  this function in the admin:database-set-foreign-replicas
  
  function to place the replica database configuration into the cluster
  configuration.
  
  xquery version "1.0-ml";
  import module namespace admin = "http://marklogic.com/xdmp/admin"
      at "/MarkLogic/admin.xqy";
  let $fdb := 7746794057802787479
  let $cfg := admin:get-configuration()
  let $fcl := admin:cluster-get-foreign-cluster-id($cfg, "ClusterA")
  return admin:database-foreign-replica($fcl, $fdb, fn:true(), 300)
  (: Returns the replica database configuration. Use the
  admin:database-set-foreign-replicas function to set the configuration. :)
    
  
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.