You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-17Lines changed: 1 addition & 17 deletions
Original file line number
Diff line number
Diff line change
@@ -99,7 +99,7 @@ app.use(qs({
99
99
*/
100
100
```
101
101
102
-
### 3. Most Usage In Queries
102
+
### 3. Supported Query Strings
103
103
#### 3.1 Partial Answers
104
104
| Query | Description | Result |
105
105
| ------ | ------ | ------ |
@@ -163,22 +163,6 @@ app.use(qs({
163
163
* The **date_field** parameter in the options is used in cases where you want to use filters with Date. If this value is not specified in the middleware configuration options, its default value will be 'created_at'.
164
164
* The configurations that you don't set in middleware options it will be the default settings.
165
165
166
-
### Query Support
167
-
168
-
This middleware supports the queries as follow the pattern bellow:
169
-
170
-
| Operation | Query | Description | Result |
171
-
| ------ | ------ | ------ | ------ |
172
-
| Partial Responses |`?fields=name,age`| Allows you to retrieve only the information you want. To do this, simply provide the name of the attributes/properties separated by commas, `?fields=name,age` indicates that only the name and age should be listed in the result of the request. |`{ fields: { name: 1, age: 1 } }`|
173
-
| Pagination with skip |`?skip=0&limit=100`| Determines how many items to skip and the maximum number that the request should return. |`{ pagination: { skip: 0, limit: 100 } }`|
174
-
| Pagination with page |`?page=2&limit=100`| Determines the page number and the maximum number of items the request should return. | { `pagination: { page: 2, limit: 100 } }`|
175
-
| Ordenation |`?sort=name,-age`| Allows you to apply sort rules. To do this, simply provide the name of the attributes/properties that will be used to sort the result of the query separated by commas. For ascending _(ascending)_ use before the attribute name the `+` character and for descending _(descending)_ use the `-` character. By default the order is ascending, so the `+` character is optional, just inform the attribute name. |`{ sort: { name: 'asc', age: 'desc' }` }|
176
-
| Filters |`?name=elvis&age=83`| It allows limiting the number of resources requested, specifying some attributes and their expected values. To do this, simply use the attribute/property name with an equal sign and the expected value. `?name=elvis` indicates that the request should return the data that has the exact same name as Elvis, `?name=elvis,john` indicates that the name is equal to Elvis or John and `?age=18&age=25` indicates that age is equal to 18 and 25.[²](#notes)|`{ filters: { name : 'elvis', age: 83 } }`|
177
-
178
-
179
-
**NOTES**
180
-
* In the last release, is possible filter for sub-level seaches - like `location.city=New York`, advanced filters like `AND`, `<`, `<=`, `>`, `>=`,`OR`,`LIKE` and `Date`.
181
-
* The middleware has the following reserved words: `skip`, `page`, `limit`, `start_at`, and `end_at`. Therefore, the use of these words in querystrings outside the context of the middleware may generate a different operation than expected.
182
166
## Future Features
183
167
- ¹Support for relational databases such as MySQL, PostgreSQL and SQLite.
0 commit comments