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 77# create instance
88jb = JsonBox ()
99
10- data = [{"name" : "David " , "age" : "25" }, {"name" : "Alice " , "age" : "19" }]
10+ data = [{"name" : "first " , "age" : 25 }, {"name" : "second " , "age" : 19 }]
1111
1212# write data
1313result = jb .write (data , MY_BOX_ID )
2424# read all records in box with sort
2525print (jb .read (MY_BOX_ID , sort_by = "age" ))
2626
27+ # read records in box with sort matching query (see documentation for syntax)
28+ print (jb .read (MY_BOX_ID , query = "name:firs*" ))
29+ print (jb .read (MY_BOX_ID , query = "age:=19" ))
30+
31+ # read records with limit
32+ print (jb .read (MY_BOX_ID , limit = 1 ))
33+
34+ # read records with skip
35+ print (jb .read (MY_BOX_ID , skip = 1 ))
36+
2737# update data
2838data = {"name" : "Bob" , "age" : "25" }
2939jb .update (data , MY_BOX_ID , record_ids [0 ])
You can’t perform that action at this time.
0 commit comments