MarkLogic 9 Product Documentation
admin:get-configuration

admin:get-configuration() as element(configuration)

Summary

Loads the admin configuration into memory for use by other functions in the Admin module.

Required Privileges

http://marklogic.com/xdmp/privileges/admin-module-read

Usage Notes

The configuration is loaded into memory only as it is needed, so it might not contain the entire configuration at any given moment. It loads only the parts of the configuration that are needed at the time they are needed to perform other Admin module operations that specified in the XQuery request. Therefore, if you execute the function without calling any other Admin module functions, it will return the empty sequence (because it never needed any of the config information to perform any of the Admin module operations).

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-get-range-element-indexes($config,
                           xdmp:database("Documents") )

  => The xml for any element range indexes in the "Documents"
     database, for example:
   <range-element-index xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
	                xmlns="http://marklogic.com/xdmp/database">
      <scalar-type>date</scalar-type>
      <collation/>
      <namespace-uri>mynamespace</namespace-uri>
      <localname>myelementname</localname>
      <range-value-positions>false</range-value-positions>
   </range-element-index>

   (: returns the new configuration element -- use admin:save-configuration
      to save the changes to the configuration or pass the configuration
      to other Admin API functions to make other changes.  :)
  
Powered by MarkLogic Server | Terms of Use | Privacy Policy