diff --git a/README.md b/README.md index 8fb3fe6..db28a24 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,9 @@ The `jsonpath2.path.Path` class represents a JSONPath. >>> from jsonpath2.path import Path >>> p = Path.parse_str('$["hello"]') ->>> list(map(lambda match_data: match_data.current_value, p.match(d))) +>>> [match_data.current_value for match_data in p.match(d)] ['Hello, world!'] ->>> list(map(lambda match_data: match_data.node.tojsonpath(), p.match(d))) +>>> [match_data.node.tojsonpath() for match_data in p.match(d)] ['$["hello"]'] ``` @@ -130,9 +130,9 @@ The syntax for a function call is the name of the function followed by the argum >>> from jsonpath2.path import Path >>> p = Path.parse_str('$["hello"][length()]') ->>> list(map(lambda match_data: match_data.current_value, p.match(d))) +>>> [m.current_value for m in p.match(d)] [13] ->>> list(map(lambda match_data: match_data.node.tojsonpath(), p.match(d))) +>>> [m.node.tojsonpath() for m in p.match(d)] ['$["hello"][length()]'] ```