$$jsonpath
Query a JSON document using JSONPath
Usage​
"$$jsonpath(<path>,[options]):{input}"
{
"$$jsonpath": /* value */,
"path": /* jsonpath string */,
"options": [/* configurations string */]
}
Returns​
Depends on the expression
Arguments​
Argument | Type | Values | Required / Default Value | Description |
---|---|---|---|---|
Primary | any | Yes | Object to query | |
path | string | Yes | JSONPath expression | |
options | string[] | A list of options by jayway | [] | Configurations for the resolver |
Examples​
Input
Definition
Output
{
"arr": [
null,
"boo"
]
}
"$$jsonpath('\\\\$.arr[1]'):$"
"boo"
[
{ "id": 1, "active": true },
{ "id": 3, "active": false },
{ "id": 4, "active": true },
{ "id": 5, "active": false }
]
"$$jsonpath('\\\\$[*][?(@.active == true)]'):$"
[
{ "id": 1, "active": true },
{ "id": 4, "active": true }
]
{
"path": "$.path"
}
"$$jsonpath($.path):$"
"$.path"