MarkLogic 12 EA 1 Product Documentation
admin.forestExists

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

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

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