Loading TOC...

MarkLogic 12 EA 2 Product Documentation
admin.databaseFieldReference

admin.databaseFieldReference(
   scalar-type as String,
   fieldname as String,
   collation as String?
) as element(db.fieldReference)

Summary

This function creates a db:field-reference specification.

Parameters
scalar-type A valid type for the range index. Must be one of: int, unsignedInt, long, unsignedLong, float, double, decimal, dateTime, time, date, gYearMonth, gYear, gMonth, gDay, yearMonthDuration, dayTimeDuration, string, anyURI, or point.
fieldname The name of the field.
collation The collation URI (for example, http://marklogic.com/collation/). The collation is only needed for string and anyURI indexes; for other indexes, specify the empty string ("") for this parameter.

Example

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>

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