Loading TOC...

MarkLogic 12 EA 2 Product Documentation
admin:forest-exists

admin:forest-exists(
   $config as element(configuration),
   $forest-name as xs:string
) as xs:boolean

Summary

This function determines whether or not the specified forest exists. Returns true if the forest exists, otherwise false is returned.

Parameters
config A configuration specification, typically as returned from one of the Admin module functions.
forest-name The name of the forest to check.

Example


  xquery version "1.0-ml";

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

  let $config := admin:get-configuration()

  return admin:forest-exists($config, "Documents")

  (: Returns true, if the Documents forest exists. :)
    

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