admin:database-validate-field-paths( $config as element(configuration), $database-id as xs:unsignedLong, $field-paths as element(db:field-path)* ) as empty-sequence()
This function checks if the paths conform to the permissible XPath syntax. If
any of the paths doesn't, it will return an error. Conformance to the
permissible syntax for an individual path can also be checked using function
cts:valid-index-path
.
Parameters | |
---|---|
config | A configuration specification, typically as returned from one of the Admin module functions. |
database-id |
The ID of the database (for example,
xdmp:database("myDatabase")
).
|
field-paths | The sequence of field-path elements, typically created using admin:database-field-path call. |
xquery version "1.0-ml"; import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; declare namespace db="http://marklogic.com/xdmp/database"; let $field-path := admin:database-field-path("/a/b/@c", 3.0) let $config := admin:get-configuration() let $dbid := xdmp:database("Documents") return admin:database-validate-field-paths( $config, $dbid, $field-path/path)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.