
admin:forest-foreign-master-get-forest-id( $foreign-master as element(as:foreign-master) ) as xs:unsignedLong
This function returns the id for the forest from the foreign master forest configuration element.
  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-master($cfg, xdmp:forest("Documents"))
  return admin:forest-foreign-master-get-forest-id($fmforest)
  (: Returns the id for the foreign master forest. :)
    
  
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.