cts.jsonPropertyScopeQuery( property-name as String[], query as cts.query ) as cts.jsonPropertyScopeQuery
Returns a cts:query
matching JSON properties by name
with the content constrained by the given cts:query
in the
second parameter.
Searches for matches in the specified property and all of its descendants.
cts:json-property-scope-query
. The position indexes enable MarkLogic
Server to eliminate many false-positive results, which can reduce
disk I/O and processing, thereby speeding the performance of many queries.
The amount of benefit will vary depending on your data.
// Given a database that has a JSON document as follows: // {"a":"aa","new":["array","content"],"b":["aa","bb"]} cts.search(cts.jsonPropertyScopeQuery( 'a', 'aa')) // Returns a relevance-ordered sequence of JSON documents (including // the above document) with a property named "a" having a // value of "aa".