Skip to content

Commit dcd8fa3

Browse files
committed
Tweak docs.
1 parent 5e1772a commit dcd8fa3

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

‎docs/quickstart.md‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,9 @@ other_users = path.findall(other_data)
135135

136136
## `match(path, data)`
137137

138-
Get a [`jsonpath.JSONPathMatch`](api.md#jsonpath.JSONPathMatch) instance for the first match found in _data_. If there are no matches, `None` is returned.
138+
**_New in version 0.8.0_**
139+
140+
Get a [`jsonpath.JSONPathMatch`](api.md#jsonpath.JSONPathMatch) instance for the first match found in _data_. If there are no matches, `None` is returned. `match()` accepts the same arguments as [`findall()`](#findall).
139141

140142
```python
141143
import jsonpath
@@ -162,13 +164,15 @@ data = {
162164
}
163165

164166
match = jsonpath.match("$.users[[email protected] > 85].name", data)
165-
if match is not None:
167+
if match:
166168
print(match) # 'Sue' @ $['users'][0]['name']
167169
print(match.obj) # Sue
168170
```
169171

170172
## `resolve(pointer, data)`
171173

174+
**_New in version 0.8.0_**
175+
172176
Resolve a [JSON Pointer](https://datatracker.ietf.org/doc/html/rfc6901). A JSON Pointer references a single object on a specific "path" in a JSON document. Here, _pointer_ can be a string representation of a JSON Pointer, or a list of parts that make up a pointer. _data_ can be a file-like object or string containing JSON formatted data, or equivalent Python objects.
173177

174178
```python

0 commit comments

Comments
 (0)