Loading TOC...

MarkLogic 12 EA 2 Product Documentation
admin.databaseValidateFieldPaths

admin.databaseValidateFieldPaths(
   config as element(configuration),
   database-id as (Number|String),
   field-paths as element(db.fieldPath)[]
) as null

Summary

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.

Example



const admin = require('/MarkLogic/admin.xqy');

const db="http://marklogic.com/xdmp/database";
const fieldPath = admin.databaseFieldPath("/a/b/@c", 3.0)
const config = admin.getConfiguration()
const dbid = xdmp.database("Documents")
admin.databaseValidateFieldPaths(
  config,
  dbid,
  fieldPath)
    

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