diff options
author | Kenn Knowles <kenn.knowles@gmail.com> | 2013-06-14 18:15:22 -0400 |
---|---|---|
committer | Kenn Knowles <kenn.knowles@gmail.com> | 2013-06-14 18:15:22 -0400 |
commit | 9558f4ac442e5fe3fbcea5c38343008932aa7372 (patch) | |
tree | 797de158b8f59ee02271c8a2286d0eff3d85858e | |
parent | 27cdaad57dbe2941b671cadbf5195e22193ef1c7 (diff) | |
download | jsonpath-rw-9558f4ac442e5fe3fbcea5c38343008932aa7372.tar.gz |
Add quick example of `parent`
-rw-r--r-- | README.md | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -48,6 +48,10 @@ $ python >>> [match.value for match in parse('foo[*].id').find({'foo': [{'id': 'bizzle'}, {'baz': 3}]})] ['foo.bizzle', 'foo.[1]'] +# A handy extension: named operators like `parent` +>>> [match.value for match in parse('a.*.b.`parent`.c').find({'a': {'x': {'b': 1, 'c': 'number one'}, 'y': {'b': 2, 'c': 'number two'}}})] +['number two', 'number one'] + # You can also build expressions directly quite easily >>> jsonpath_expr_direct = Fields('foo').child(Slice('*')).child(Fields('baz')) # This is equivalent ``` |