Loading TOC...

admin:forest-foreign-replica-get-database-id

admin:forest-foreign-replica-get-database-id(
   foreign-replica as element(as:foreign-replica)
) as xs:unsignedLong

Summary

This function returns the id of the replica database from the specified replica forest configuration element. This function must be executed on the master cluster.

Parameters
foreign-replica The element returned by the admin:forest-foreign-replica or admin:forest-get-foreign-replicas function that specifies the configuration for the replica forest.

Example


  xquery version "1.0-ml";

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

  let $cfg := admin:get-configuration()
  let $fmforest := admin:forest-get-foreign-replicas($cfg, xdmp:forest("Documents"))

  return admin:forest-foreign-replica-get-database-id($fmforest)

  (: Returns the id for the foreign replica database configured for the
     master 'Documents' forest. :)
    

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