|
|
|
@ -29,7 +29,7 @@ Operators
|
|
|
|
|
| `*` | Wildcard. Available anywhere a name or numeric are required. | |
|
|
|
|
| `..` | Deep scan. Available anywhere a name is required. | |
|
|
|
|
| `.<name>` | Dot-notated child | |
|
|
|
|
| `['<name>' (, '<name>)']` | Bracket-notated child or children | |
|
|
|
|
| `['<name>' (, '<name>')]` | Bracket-notated child or children | |
|
|
|
|
| `[<number> (, <number>)]` | Array index or indexes | |
|
|
|
|
| `[start:end]` | Array slice operator | |
|
|
|
|
| `[?(<expression>)]` | Filter expression. Expression must evaluate to a boolean value. | |
|
|
|
@ -74,7 +74,8 @@ Given the
|
|
|
|
|
"color": "red", |
|
|
|
|
"price": 19.95 |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
}, |
|
|
|
|
"expensive price": 10 |
|
|
|
|
} |
|
|
|
|
``` |
|
|
|
|
|
|
|
|
@ -92,7 +93,8 @@ Given the
|
|
|
|
|
| `$..book[-2:]` | Last two books | |
|
|
|
|
| `$..book[2:]` | Book number two from tail | |
|
|
|
|
| `$..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 | |
|
|
|
|
|
|
|
|
|
|
|
|
|
|