
admin:database-path-reference( $scalar-type as xs:string, $pathexpr as xs:string, $collation as xs:string? ) as element(db:path-reference)
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.
|
xquery version "1.0-ml";
import module namespace admin = "http://marklogic.com/xdmp/admin"
at "/MarkLogic/admin.xqy";
admin:database-path-reference("int", "/my/path[a=1]", "")
=>
<path-reference xmlns="http://marklogic.com/xdmp/database">
<scalar-type>int</scalar-type>
<path-expression>/my/path[a=1]</path-expression>
<collation/>
</path-reference>
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.