admin:database-validate-field-path( $config as element(configuration), $database-id as xs:unsignedLong, $field-path as element(db:field-path) ) as empty-sequence()
This function validates the specified field path. If the specified path is not valid, it throws an exception, otherwise it returns the empty sequence.
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-path |
The field path specification, typically the result of a call to
admin:database-get-field-paths
.
|
xquery version "1.0-ml"; import module namespace admin = "http://marklogic.com/xdmp/admin" at "/MarkLogic/admin.xqy"; let $config := admin:get-configuration() let $databaseid := xdmp:database("Documents") let $field := "myField" let $field-path := admin:database-get-field-paths($config, $databaseid, $field) return admin:database-validate-field-path($config, $databaseid, $field-path) (: returns empty if the patha is OK, throws an exception if the path is not valid :)
Stack Overflow: Get the most useful answers to questions from the MarkLogic community, or ask your own question.