Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 0ae9dc2

Browse files
authored
Update README.md
1 parent 19de2fb commit 0ae9dc2

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

‎README.md‎

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,18 @@ print(jb.read(MY_BOX_ID, limit=1))
4949
print(jb.read(MY_BOX_ID, skip=1))
5050

5151
# update data
52-
data = {"name": "Bob", "age": "25"}
52+
data = {"name": "Bob", "age": 23}
5353
jb.update(data, MY_BOX_ID, record_ids[0])
5454

5555
# read updated data
56+
print(jb.read(MY_BOX_ID))
5657
print(jb.read(MY_BOX_ID, record_ids[0]))
5758

59+
# delete records matching to query
60+
print(jb.delete(MY_BOX_ID, query="age:=23"))
61+
5862
# delete records
59-
jb.delete(MY_BOX_ID, record_ids)
63+
jb.delete(MY_BOX_ID, record_ids[1])
6064
```
6165

6266
## Query Params
@@ -92,6 +96,11 @@ You can combine multiple fields by separating them with commas as shown below:
9296
name:arya%20stark,age:>13,isalive:true
9397
```
9498

99+
#### Deleting records
100+
There are two ways to delete records (see examples above for both)
101+
* Provide the `record_id`
102+
* Provide a `query` parameter, with the same syntax used for filtering on read
103+
95104
## Use your own instance of jsonbox
96105
```
97106
jb = JsonBox(service_host="https://my-jsonbox-server.com")

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /