|
|
@ -29,7 +29,7 @@ Operators |
|
|
|
| `*` | Wildcard. Available anywhere a name or numeric are required. | |
|
|
|
| `*` | Wildcard. Available anywhere a name or numeric are required. | |
|
|
|
| `..` | Deep scan. Available anywhere a name is required. | |
|
|
|
| `..` | Deep scan. Available anywhere a name is required. | |
|
|
|
| `.<name>` | Dot-notated child | |
|
|
|
| `.<name>` | Dot-notated child | |
|
|
|
| `['<name>' (, '<name>)']` | Bracket-notated child or children | |
|
|
|
| `['<name>' (, '<name>')]` | Bracket-notated child or children | |
|
|
|
| `[<number> (, <number>)]` | Array index or indexes | |
|
|
|
| `[<number> (, <number>)]` | Array index or indexes | |
|
|
|
| `[start:end]` | Array slice operator | |
|
|
|
| `[start:end]` | Array slice operator | |
|
|
|
| `[?(<expression>)]` | Filter expression. Expression must evaluate to a boolean value. | |
|
|
|
| `[?(<expression>)]` | Filter expression. Expression must evaluate to a boolean value. | |
|
|
@ -74,7 +74,8 @@ Given the |
|
|
|
"color": "red", |
|
|
|
"color": "red", |
|
|
|
"price": 19.95 |
|
|
|
"price": 19.95 |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
"expensive price": 10 |
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
@ -93,6 +94,7 @@ Given the |
|
|
|
| `$..book[2:]` | Book number two from tail | |
|
|
|
| `$..book[2:]` | Book number two from tail | |
|
|
|
| `$..book[?(@.isbn)]` | All books with an ISBN number | |
|
|
|
| `$..book[?(@.isbn)]` | All books with an ISBN number | |
|
|
|
| `$.store.book[?(@.price < 10)]` | All books in store cheaper than 10 | |
|
|
|
| `$.store.book[?(@.price < 10)]` | All books in store cheaper than 10 | |
|
|
|
|
|
|
|
| `$.store.book[?(@.price <= $['expensive price'])]` | All books in store that are not "expensive" | |
|
|
|
| `$..*` | Give me every thing you got | |
|
|
|
| `$..*` | Give me every thing you got | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|