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("-", "_")
2121# create instance
2222jb = JsonBox()
2323
24- data = [{" name" : " David " , " age" : " 25 " }, {" name" : " Alice " , " age" : " 19 " }]
24+ data = [{" name" : " first " , " age" : 25 }, {" name" : " second " , " age" : 19 }]
2525
2626# write data
2727result = jb.write(data, MY_BOX_ID )
@@ -38,6 +38,16 @@ print(jb.read(MY_BOX_ID))
3838# read all records in box with sort
3939print (jb.read(MY_BOX_ID , sort_by = " age" ))
4040
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+
4151# update data
4252data = {" name" : " Bob" , " age" : " 25" }
4353jb.update(data, MY_BOX_ID , record_ids[0 ])
You can’t perform that action at this time.
0 commit comments