Skip to content

Commit 4cea752

Browse files
committed
add update and delete doc
1 parent 5d653b2 commit 4cea752

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@ Then:
3838
>>> [match.value for match in jsonpath_expr.find({'foo': [{'baz': 1}, {'baz': 2}]})]
3939
[1, 2]
4040
41+
# Update values
42+
>>> jsonpath_expr.update({'foo': [{'baz': 1}, {'baz': 2}]}, 3)
43+
{'foo': [{'baz': 3}, {'baz': 3}]}
44+
45+
# Delete values
46+
>>> jsonpath_expr.delete({'foo': [{'baz': 1}, {'baz': 2}]})
47+
{'foo': []}
48+
4149
# Matches remember where they came from
4250
>>> [str(match.full_path) for match in jsonpath_expr.find({'foo': [{'baz': 1}, {'baz': 2}]})]
4351
['foo.[0].baz', 'foo.[1].baz']

0 commit comments

Comments
 (0)