Perl 6 implementation of JSONPath.
Latest commit dc7cddd Oct 26, 2016 @jnthn committed on GitHub Merge pull request #5 from zoffixznet/patch-1
Add mandatory "perl" META field
Failed to load latest commit information.
lib/JSON Fix for current rakudo Oct 4, 2015
t Fix for current rakudo Oct 4, 2015
.travis.yml add travis configuration file Oct 11, 2015
LICENSE.txt Add mandatory "perl" META field Oct 26, 2016 [] added one more case Oct 20, 2012

JSON::Path gives you the power to deeply index data structures (containing arrays and hashes) with path expressions.

# index into { kitchen => { drawers => [ { fork => '!' } ] } }
my $path ='$.kitchen.drawers[0].fork');

JsonPath is like XPath but adapted for JSON. It simplifies and adapts the path expressions a bit, to better fit the data structures stored by JSON. You can read more about the syntax by following that link there, but here's a summary:

$           root node
.key        index hash key
.*          index all hash keys
['key']     index hash key
[2]         index array element
[0,1]       index array slice
[4:5]       index array range
[:5]        index from the beginning
[-3:]       index to the end
[*]         index all array elements
[?(expr)]   filter on (Perl 6) expression
..key       search all descendants for hash key

The module is functionally a port of CPAN's JSON::Path, even though the internals look quite different.