Loading TOC...


   config as element(configuration),
   forest-name as String,
   host-id as (Number|String),
   data-directory as String?,
   [large-data-directory as String?],
   [fast-data-directory as String?]
) as element(configuration)


This function creates a new forest configuration.

config A configuration specification, typically as returned from one of the Admin module functions.
forest-name The name of the forest. The must be unique for all forests in the cluster.
host-id The ID of the host (for example, xdmp:host()) for the current host.
data-directory The optional data directory of the forest. If no directory is specified, then it will be a private forest.
large-data-directory The optional directory where large objects are stored. If no directory is specified, then large objects will be stored in DATA_DIR/Forests/FOREST_NAME/Large.
fast-data-directory The optional directory for the fast data directory for this forest. The fast data directory is typically located on a fast storage device, such as an SSD.

Required Privileges



  const admin = require('/MarkLogic/admin.xqy');
  admin.forestCreate(admin.getConfiguration(), "newForest", xdmp.host(), null)
   => returns the new configuration element -- use admin.saveConfiguration
      to save the changes to the configuration or pass the configuration
      to other Admin API functions to make other changes.


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