admin.databaseFieldReference( scalar-type as String, fieldname as String, collation as String? ) as element(db.fieldReference)
This function creates a db:field-reference specification.
const admin = require('/MarkLogic/admin.xqy'); admin.databaseFieldReference("int", "myIntegerField", "") => <fieldReference xmlns="http://marklogic.com/xdmp/database"> <scalarType>int</scalarType> <fieldName>myIntegerField</fieldName> <collation/> </fieldReference>