Pastry provides a powerful JSONPath search feature. In the JSON viewer, you can use standard JSONPath syntax in the input box at the bottom to filter and query data.
| Symbol | Description |
|---|---|
$ |
Root node, represents the entire JSON document. |
. |
Direct child of the current node. |
.. |
Recursive descent, searches all descendants. |
* |
Wildcard, matches all members or array elements. |
[] |
Subscript operator for array indices or object properties (with quotes). |
The following JSON snippet is used in the examples below:
{
"store": {
"book": [
{
"category": "reference",
"author": "Nigel Rees",
"title": "Sayings of the Century",
"price": 8.95
},
{
"category": "fiction",
"author": "Evelyn Waugh",
"title": "Sword of Honour",
"price": 12.99,
"isbn": "0-553-21311-3"
}
],
"bicycle": {
"color": "red",
"price": 19.95
}
}
}$.store.book[*]
$.store.book[*].author
$..price
$.store.book[0]
$.store.book[0:2]
JSONPath supports conditional queries using ?().
$.store.book[?(@.price > 10)]
$.store.book[?(@.isbn)]
- Enter any of the paths above in the input box at the bottom.
- Press Enter (Return).
- The view will show only the results that match the path.
- Clear the input box and press Enter to show the full JSON again.