admin.databaseAddPathNamespace( config as element(configuration), database-id as (Number|String), path-namespaces as element(db.pathNamespace)[] ) as element(configuration)
Add one or more namespaces to a database configuration, which will predefine the namespace(s) for all XPath expressions used in range index definitions.
http://marklogic.com/xdmp/privileges/admin/database
http://marklogic.com/xdmp/privileges/admin/database/{id}
http://marklogic.com/xdmp/privileges/admin/database/index
http://marklogic.com/xdmp/privileges/admin/database/index/{id}
const admin = require('/MarkLogic/admin.xqy'); var config = admin.getConfiguration() var dbid = xdmp.database("Documents") var nsspec = admin.databasePathNamespace("aaa", "http://aaa.com") admin.databaseAddPathNamespace(config, dbid, nsspec) //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.