File tree Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Expand file tree Collapse file tree 1 file changed +11
-1
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ MY_BOX_ID = str(uuid.uuid4()).replace("-", "_")
21
21
# create instance
22
22
jb = JsonBox()
23
23
24
- data = [{" name" : " David " , " age" : " 25 " }, {" name" : " Alice " , " age" : " 19 " }]
24
+ data = [{" name" : " first " , " age" : 25 }, {" name" : " second " , " age" : 19 }]
25
25
26
26
# write data
27
27
result = jb.write(data, MY_BOX_ID )
@@ -38,6 +38,16 @@ print(jb.read(MY_BOX_ID))
38
38
# read all records in box with sort
39
39
print (jb.read(MY_BOX_ID , sort_by = " age" ))
40
40
41
+ # read records in box with sort matching query (see documentation for syntax)
42
+ print (jb.read(MY_BOX_ID , query = " name:firs*" ))
43
+ print (jb.read(MY_BOX_ID , query = " age:=19" ))
44
+
45
+ # read records with limit
46
+ print (jb.read(MY_BOX_ID , limit = 1 ))
47
+
48
+ # read records with skip
49
+ print (jb.read(MY_BOX_ID , skip = 1 ))
50
+
41
51
# update data
42
52
data = {" name" : " Bob" , " age" : " 25" }
43
53
jb.update(data, MY_BOX_ID , record_ids[0 ])
You can’t perform that action at this time.
0 commit comments