<?xml version="1.0" encoding="UTF-8"?><api:function-page xml:base="/apidoc/8.0/cts.jsonPropertyScopeQuery.xml" generated="2015-10-07T16:36:00.016766-07:00" mode="javascript" xmlns:api="http://marklogic.com/rundmc/api"><api:function-name>cts.jsonPropertyScopeQuery</api:function-name><api:suggest>cts.jsonpropertyscopequery</api:suggest><api:suggest>cts</api:suggest><api:suggest>jsonpropertyscopequery</api:suggest><api:function-link mode="xquery" fullname="cts:json-property-scope-query">/apidoc/8.0/cts:json-property-scope-query.xml</api:function-link><api:function mode="javascript" name="jsonPropertyScopeQuery" type="builtin" lib="cts" category="SearchBuiltins" subcategory="cts:query Constructors" hidden="false" bucket="MarkLogic Built-In Functions" prefix="cts" namespace="http://marklogic.com/cts" fullname="cts.jsonPropertyScopeQuery"><api:summary>
  Returns a <code xmlns="http://www.w3.org/1999/xhtml">cts:query</code> matching JSON properties by name
  with the content constrained by the given <code xmlns="http://www.w3.org/1999/xhtml">cts:query</code> in the
  second parameter.
  Searches for matches in the specified property and all of its descendants.
</api:summary><api:params><api:param name="property-name" type="xs:string*"><api:param-description>
    One or more property names to match.
    When multiple names are specified,
    the query matches if any name matches.
  </api:param-description><api:param-name>property-name</api:param-name><api:param-type>String[]</api:param-type></api:param><api:param name="query" type="cts:query"><api:param-description>
    A query for the property to match.  If a string
   is entered, the string is treated as a <code xmlns="http://www.w3.org/1999/xhtml">cts:word-query</code> of the
   specified string.
  </api:param-description><api:param-name>query</api:param-name><api:param-type>cts.query</api:param-type></api:param></api:params><api:return>cts.jsonPropertyScopeQuery</api:return><api:usage>
  Enabling both the word position and property position indexes will
  speed up query performance for many queries that use
  <code xmlns="http://www.w3.org/1999/xhtml">cts:json-property-scope-query</code>. 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.
</api:usage><api:example class="javascript"><pre xml:space="preserve" xmlns="http://www.w3.org/1999/xhtml">
// Given a database that has a JSON document as follows:
//  {"a":"aa","new":["array","content"],"b":["aa","bb"]}

  cts.search(cts.jsonPropertyScopeQuery(
      "a",
      "aa"))

  =&gt; .. relevance-ordered sequence of JSON documents (including
     the above document) with a property named "a" having a
     value of "aa".
</pre></api:example></api:function></api:function-page>