admin:appserver-get-modules-database( $config as element(configuration), $appserver-id as xs:unsignedLong ) as xs:unsignedLong
This function returns the ID of the database set as the modules database for the specified database.
http://marklogic.com/xdmp/privileges/admin/app-server
http://marklogic.com/xdmp/privileges/admin/app-server/{id}
This function throws an exception if the specified App Server is a WebDAV server (because WebDAV servers do not use a modules database).
xquery version "1.0-ml"; import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; let $config := admin:get-configuration() let $groupid := admin:group-get-id($config, "Default") return admin:appserver-get-modules-database($config, admin:appserver-get-id($config, $groupid, "myAppServer"))
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.