Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@ The `jsonpath2.path.Path` class represents a JSONPath.
>>> from jsonpath2.path import Path
>>> p = Path.parse_str('$["hello"]')
<jsonpath2.path.Path object>
>>> 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"]']
```

Expand Down Expand Up @@ -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()]')
<jsonpath2.path.Path object>
>>> 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()]']
```

Expand Down