MarkLogic Server 11.0 Product Documentation
admin:database-exists

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

Summary

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

Parameters
config A configuration specification, typically as returned from one of the Admin module functions.
database-name The name of the database 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:database-exists($config, "Documents")

  (: Returns true if the Documents database exists. :)
    
Powered by MarkLogic Server | Terms of Use | Privacy Policy