Fork me on GitHub

ObjectPath

The most agile query language for JSON

Find in the shop all shoes of red color and price less than 50

$..shoes.*[color is "red" and price < 50]

$ - the root of the document

$ points to the root of the document. It can be either object or a list of objects. ObjectPath queries works for both! Here the document describes a shop and products available.

.. - recursive descent

.. selects all objects from the subtree. Here it selects all objects from the shop.

* - the wildcard

* selects all objects from array.

. - child/property

. selects a child or property of the subtree element. It supports arrays of objects and objects; finds property in object or all properties in objects in an array of objects.

[] - selector

[] is an advanaced tool for filtering lists of objects. It can do almost anything! More at selectors reference

and, or, < - simple operators

ObjectPath supports a vast range of simple operators including boolean, arithmetic, comparison... and so on. The full list of operators is available in the ObjectPath reference.

Object properties

These are properties of objects that will be checked against the expression.