MarkLogic 12 EA 1 Product Documentation
admin:database-foreign-master

admin:database-foreign-master(
   $foreign-cluster-id as xs:unsignedLong,
   $foreign-database-id as xs:unsignedLong,
   $connect-forests-by-name as xs:boolean
) as element(db:foreign-master)

Summary

This function returns a master database configuration. Use the output of this function in the admin:database-set-foreign-master function to set the master database configuration.

Parameters
foreign-cluster-id The ID of the foreign cluster containing the master host.
foreign-database-id The ID of the master database.
connect-forests-by-name Boolean that indicates whether to connect to forests by name. If fn:true, forests will automatically connect to/from foreign forests of the same name. If false, forests must be individually configured to replicate to/from foreign forests. Individual forest settings override the database level setting.

Example


  xquery version "1.0-ml";

  import module namespace admin = "http://marklogic.com/xdmp/admin"
      at "/MarkLogic/admin.xqy";

  let $fdb := 476761383313557950
  let $cfg := admin:get-configuration()
  let $fcl := admin:cluster-get-foreign-cluster-id($cfg, "ClusterA")

  return admin:database-foreign-master($fcl, $fdb, fn:true())

  (: Returns a master database configuration element.  Use the
     admin:database-set-foreign-master function to set the
     configuration. :)
    
Powered by MarkLogic Server | Terms of Use | Privacy Policy