Browse Source

Adjested readme for multi-filter functionality

Maurits van der Schee 10 years ago
parent
commit
bf62300794
1 changed files with 15 additions and 15 deletions
  1. 15
    15
      README.md

+ 15
- 15
README.md View File

@@ -118,23 +118,23 @@ Output:
118 118
 
119 119
 ### List + Filter
120 120
 
121
-Search is implemented with the "filter" parameter. You need to specify the column name, a colon and the value you want to filter on. The filter match type is "exact" by default, but can easily be adjusted. These are supported:
121
+Search is implemented with the "filter" parameter. You need to specify the column name, a comma, the match type, another commma and the value you want to filter on. These are supported match types:
122 122
 
123
-  - start (string starts with value)
124
-  - end (string end with value)
125
-  - contain (string contains value)
126
-  - exact (string or number matches exactly)
127
-  - lower (number is lower than value)
128
-  - upto (number is lower than or equal to value)
129
-  - from (number is higher than or equal to value)
130
-  - higher (number is higher than value)
131
-  - in (number is in comma seperated list of values)
123
+  - cs: contain string (string contains value)
124
+  - sw: start with (string starts with value)
125
+  - ew: end with (string end with value)
126
+  - eq: equal (string or number matches exactly)
127
+  - lt: lower than (number is lower than value)
128
+  - le: lower or equal (number is lower than or equal to value)
129
+  - ge: greater or equal (number is higher than or equal to value)
130
+  - gt: greater than (number is higher than value)
131
+  - in: in (number is in comma seperated list of values)
132 132
 
133 133
 ```
134
-GET http://localhost/api.php/categories?filter=name:Internet
135
-GET http://localhost/api.php/categories?filter=name:Inter&match=start
136
-GET http://localhost/api.php/categories?filter=id:1&match=upto
137
-GET http://localhost/api.php/categories?filter=id:2&match=lower
134
+GET http://localhost/api.php/categories?filter=name,eq,Internet
135
+GET http://localhost/api.php/categories?filter=name,sw,Inter
136
+GET http://localhost/api.php/categories?filter=id,le,1
137
+GET http://localhost/api.php/categories?filter=id,lt,2
138 138
 ```
139 139
 
140 140
 Output:
@@ -239,7 +239,7 @@ The explanation of this feature is based on the datastructure from the ```blog.s
239 239
 You can get the "post" that has "id" equal to "1" with it's corresponding "categories", "tags" and "comments" using:
240 240
 
241 241
 ```
242
-GET http://localhost/api.php/posts,categories,tags,comments?filter=id:1
242
+GET http://localhost/api.php/posts,categories,tags,comments?filter=id,eq,1
243 243
 ```
244 244
 
245 245
 Output:

Loading…
Cancel
Save