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 7
7
# create instance
8
8
jb = JsonBox ()
9
9
10
- data = [{"name" : "David " , "age" : "25" }, {"name" : "Alice " , "age" : "19" }]
10
+ data = [{"name" : "first " , "age" : 25 }, {"name" : "second " , "age" : 19 }]
11
11
12
12
# write data
13
13
result = jb .write (data , MY_BOX_ID )
24
24
# read all records in box with sort
25
25
print (jb .read (MY_BOX_ID , sort_by = "age" ))
26
26
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
+
27
37
# update data
28
38
data = {"name" : "Bob" , "age" : "25" }
29
39
jb .update (data , MY_BOX_ID , record_ids [0 ])
You can’t perform that action at this time.
0 commit comments