MarkLogic 9 Product Documentation
admin.databaseExists

admin.databaseExists(
   config as element(configuration),
   database-name as String
) as 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

  
  const admin = require('/MarkLogic/admin.xqy');
  var config = admin.getConfiguration()
  admin.databaseExists(config, "Documents")

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