Loading TOC...

xdmp.amp

xdmp.amp(
   namespace as String,
   localname as String,
   module-uri as String,
   database as (Number|String)
) as (Number|String)

Summary

Returns the amp ID for the specified amp. Unlike the security library module function sec.uidForName, this function can be evaluated against any database and does not need to be evaluated directly against the security database. It returns the amp ID from the security database configured for the database in which the App Server evaluates against.

Parameters
namespace A function namespace.
localname A function localname.
module-uri The module URI for the amp.
database The ID of the database in which the module to which this amp refers is stored. If the module is on the filesystem under the Modules directory, then specify 0 for the database ID.

Example

xdmp.amp("http://marklogic.com/xdmp/security", "amp-add-roles",
         "/MarkLogic/security.xqy", 0);
=> 3548369234520018804

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