Loading TOC...

MarkLogic Server 11.0 Product Documentation
admin.databaseForeignMaster

admin.databaseForeignMaster(
   foreign-cluster-id as (Number|String),
   foreign-database-id as (Number|String),
   connect-forests-by-name as Boolean
) as element(db.foreignMaster)

Summary

This function returns a master database configuration. Use the output of this function in the admin.databaseSetForeignMaster 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

  
  const admin = require('/MarkLogic/admin.xqy');
  const fdb = 476761383313557950
  const cfg = admin.getConfiguration()
  const fcl = admin.clusterGetForeignClusterId(cfg, "ClusterA")
  admin.databaseForeignMaster(fcl, fdb, fn.true())

   //Returns a master database configuration element.//Use the
   //admin.databaseSetForeignMaster function to set the
   //configuration. 
    

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