
admin.databaseElementReference( scalar-type as String, namespace as String?, localname as String, collation as String? ) as element(db.elementReference)
This function greated a db:element-reference specification.
const admin = require('/MarkLogic/admin.xqy');
admin.databaseElementReference("int", "", "elementName", "")
=>
<elementReference xmlns="http://marklogic.com/xdmp/database">
<scalarType>int</scalarType>
<namespaceUri/>
<localname>elementName</localname>
<collation/>
</elementReference>
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.