name(argument1, argument2, ...)A function is defined as a function name followed by comma separated arguments wrapped in round brackets. it is important to understand functions like filter, sort, and max are executed as a method in a chain: the operation is applied to the data input, and forwarded to the next method in the chain (if any).
Examples:
sort(.address.city, "asc")filter(.age >= 21) | sort(.age, "asc") Documentation:
Function reference:
left operator rightJSON Query supports all basic operators. Operators must have both a left and right hand side. To override the default precedence, an operator can be wrapped in parentheses (...).
Examples:
.age >= 18filter(.age >= 18 and .age <= 65) Documentation:
Operator reference:
query2 | query2 | ...A pipe is an array containing a series of queries. The queries in the pipeline are executed one by one, and the output of the first is the input for the next.
Example:
filter(.age >= 18) | sort(.name) Documentation:
{prop1: query1, prop2: query2, ...}An object is defined as a regular JSON object with a property name as key, and a query as value. Objects can be used to transform data or to execute multiple query pipelines in parallel.
Example:
{
names: map(.name),
numberOfNames: size()
} Documentation:
[query1, query2, ...]An array is defined as a regular JSON array: enclosed in square brackets, with items separated by a comma.
Example:
filter(.city in ["New York", "Atlanta"]) Documentation:
.prop1.prop2A property retrieves a property from an object. Multiple consecutive properties will retrieve a nested property.
Examples:
.age.address.city"first name"get()get("address", "city") Documentation:
"string", number, boolean, nullJSON Query supports the following primitive values, the same as in JSON: "string", number, boolean, null.
Examples:
"Hello world""Multi line text\nwith \"quoted\" contents"422.74-1.2e3truefalsenull Documentation: