

The main ideas behind JSONiq are based on lessons learned in more than 30 years of relational query systems and more than 15 years of experience with designing and implementing query languages for semi-structured data like XML and RDF. JSON query language Equality operator: Numeric comparison operators: >, >, <, < Search in the list of scalar values using IN. You cannot define a phrase-through or a phrase-around on JSON documents. JSONiq is a query and processing language specifically designed for the popular JSON data model.You cannot define fragment roots for JSON documents.

Note also that the xpath method returns a Sequence in JavaScript, so you may need to iterate over the results when using this method in your application.įor example, if you want to explore what happens if you apply the XPath expression /a to a JSON node that contains the data matches a value query for a property "a" with a value of 1 and a value query for a property "a" with a value of 2. Note that in XQuery you can apply an XPath expression directly to a node, but in JavaScript, you must use the Node.xpath method. The results are wrapped in a call to xdmp:describe in XQuery and scribe in JavaScript to clearly illustrate the result type, independent of Query Console formatting. If you want to use node traversal to explore what is selected by an XPath expression, you can use one of the following patterns as a template in Query Console: Applications that use the JSON-oriented query language can interact with relational and non-relational data that is stored in databases by using the wire. As such, many of the XPath examples in this chapter include just an XPath expression, with no execution context.

XPath expressions can be used in many different contexts, including explicit node traversal, query construction, and index configuration.
