Skip to main content

13.4 Using JSONata

JSONata is a lightweight query and transformation language for JSON.

Using JSONata, you can define logical conditions, comparisons, and functions to select only the records that meet specific criteria.

JSONata is used in several places.

For example in the Repository "get" API the filter parameter allows clients to refine the results by applying conditional logic to the response data. The filter is expressed as a JSONata expression.

See also: OLIVE API documentation

Key points​

  • The filter value must be a valid JSONata expression.
  • The expression is evaluated server-side against the service data.
  • Only records that satisfy the JSONata expression are included in the response.

Example use cases​

  • Filter services by specific attributes (e.g., status, type, or region)
  • Apply logical operators (and, or, not) for complex conditions
  • Perform comparisons (=, !=, <, >, <=, >=) and string operations

Testing your filter​

You can validate and experiment with your JSONata expressions using the official playground:
https://try.jsonata.org/

Reference documentation​

For a complete overview of JSONata syntax, operators, and functions, refer to the official documentation:
https://docs.jsonata.org/overview.html