1. Core JSONPath Operators
| Operator | Description | Example |
|---|---|---|
| $ | The root object or array | $ |
| . or [] | Child operator | $.store.book or $['store']['book'] |
| .. | Recursive descent (searches all descendant nodes) | $..author |
| * | Wildcard matching all elements or properties | $.store.book[*] |
| @ | Current node being evaluated in filter expressions | ?(@.price < 10) |
| ?() | Applies a logical filter expression | $.books[?(@.price > 20)] |
| [start:end] | Array slice operator | $.items[0:2] |
2. Real-World Query Examples
Sample JSON Inputstore.json
{
"store": {
"book": [
{ "category": "fiction", "author": "Herman Melville", "title": "Moby Dick", "price": 8.99 },
{ "category": "fiction", "author": "J. R. R. Tolkien", "title": "The Lord of the Rings", "price": 22.99 }
]
}
}$.store.book[*].author
["Herman Melville", "J. R. R. Tolkien"]Extracts all book authors
$..price
[8.99, 22.99]Extracts all prices anywhere in the structure
$.store.book[?(@.price < 10)]
[ Moby Dick object ]Filters books costing under $10
Test your JSONPath queries live online
Execute JSONPath expressions against any JSON payload in real time with our free client-side tool:

