sec.getAmp( namespace as String, local-name as String, document-uri as String, database as (Number|String) ) as element(sec.amp)?
Returns an sec:amp element corresponding to an amp identified by ($namespace, $local-name, $document-uri). If no such amp is found, an error is returned.
This function must be executed against the security database.
// execute this against the security database const sec = require('/MarkLogic/security.xqy'); sec.getAmp( "http://marklogic.com/xdmp/alert", "action-insert", "/MarkLogic/alert.xqy", 0) => <sec:amp xmlns:sec="http://marklogic.com/xdmp/security"> <sec:amp-id>2840630016131588040</sec:amp-id> <sec:namespace>http://marklogic.com/xdmp/alert</sec:namespace> <sec:local-name>action-insert</sec:local-name> <sec:document-uri>/MarkLogic/alert.xqy</sec:document-uri> <sec:database>0</sec:database> <sec:role-ids> <sec:role-id>4235709426772438321</sec:role-id> </sec:role-ids> </sec:amp>
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.