Loading TOC...

MarkLogic 12 EA 1 Product Documentation
admin:database-field-reference

admin:database-field-reference(
   $scalar-type as xs:string,
   $fieldname as xs:string,
   $collation as xs:string?
) as element(db:field-reference)

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



xquery version "1.0-ml";

import module namespace admin = "http://marklogic.com/xdmp/admin"
      at "/MarkLogic/admin.xqy";

admin:database-field-reference("int", "my-integer-field", "")
=>
<field-reference xmlns="http://marklogic.com/xdmp/database">
	<scalar-type>int</scalar-type>
	<field-name>my-integer-field</field-name>
	<collation/>
</field-reference>

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