MarkLogic 12 EA 1 Product Documentation
admin.databasePathReference

admin.databasePathReference(
   scalar-type as String,
   pathexpr as String,
   collation as String?
) as element(db.pathReference)

Summary

This function creates a db:path-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.
pathexpr The path expression for the index. The should path should return true from cts:valid-index-path.
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.databasePathReference("int", "/my/path[a=1]", "")
=>

<pathReference xmlns="http://marklogic.com/xdmp/database">
	<scalarType>int</scalarType>
	<pathExpression>/my/path[a=1]</pathExpression>
	<collation/>
</pathReference>
Powered by MarkLogic Server | Terms of Use | Privacy Policy