June 2015
Intermediate to advanced
192 pages
4h 8m
English
JSONPath provides an alternate notation, bracket-notation, which works just like dot-notation to query fields. The syntax is reminiscent of how you access fields in associative arrays, where you pass the field name as the selector to operator[] to obtain the value in the named field.
In bracket notation, we will write the previous recipe's example as follows:
$['store']['book'][0].['title'] $['store']['book'][*].['title'] $['store']..['price'] $..['book'][3]
As seen earlier, the first example extracts the title of the first book in the object in the field named store. The second example extracts all titles of all books in the store. The third example returns a collection ...
Read now
Unlock full access