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
@@ -10,13 +10,12 @@ To ensure the smooth operation of the middleware, your web application must be b
10
10
11
11
## Installing
12
12
Use the npm command to install this library into your project:
13
-
```
14
-
npm i --save query-strings-parser
15
-
```
13
+
```shell
14
+
npm i query-strings-parser --save
15
+
```
16
16
17
17
### Usage Examples
18
-
#### 1. Using default configurations
19
-
```js
18
+
```js
20
19
constexpress=require('express')
21
20
constqs=require('query-strings-parser')
22
21
constapp=express()
@@ -46,32 +45,9 @@ app.get('/', (req, res) => {
46
45
* }
47
46
*/
48
47
```
49
-
#### The middleware uses the following defaults:
50
-
```js
51
-
options = {
52
-
use_page:false,
53
-
client_db:'mongodb',
54
-
date_field: {
55
-
start_at:'created_at',
56
-
end_at:'created_at'
57
-
},
58
-
default: {
59
-
fields: {},
60
-
sort: {},
61
-
filters: {},
62
-
pagination: {
63
-
limit:Number.MAX_SAFE_INTEGER,
64
-
skip:0,
65
-
page:1
66
-
}
67
-
}
68
-
}
69
-
```
70
-
If the options are not provided, the default values will be used for the treatment of queries strings.
71
48
72
-
73
-
### 2. Using custom configurations:
74
-
```js
49
+
### Using custom configurations:
50
+
```js
75
51
constexpress=require('express')
76
52
constqs=require('query-strings-parser')
77
53
constapp=express()
@@ -109,17 +85,159 @@ app.use(qs({
109
85
* }
110
86
*/
111
87
```
88
+
89
+
The middleware uses the following defaults:
90
+
```js
91
+
options = {
92
+
use_page:false,
93
+
client_db:'mongodb',
94
+
date_field: {
95
+
start_at:'created_at',
96
+
end_at:'created_at'
97
+
},
98
+
default: {
99
+
fields: {},
100
+
sort: {},
101
+
filters: {},
102
+
pagination: {
103
+
limit:Number.MAX_SAFE_INTEGER,
104
+
skip:0,
105
+
page:1
106
+
}
107
+
}
108
+
}
109
+
```
110
+
111
+
If the options are not provided, the default values will be used for the treatment of queries strings.
112
112
113
113
For more details, access the [wiki](https://github.com/nutes-uepb/query-strings-parser/wiki/2.-Usage-Examples) page.
114
-
115
-
## Supported Query Strings
114
+
115
+
### Parsers Functions
116
+
To use these functions, simply call them through the middleware instance and pass them the query string to be converted and its default values. If you pass the default values a merge will be performed with the result of the query strings. Here are some examples of each analyzer:
For more [details >>](https://github.com/nutes-uepb/query-strings-parser/wiki/4.-Parsers#parsedate)
232
+
233
+
### Supported Query Strings
116
234
For informations and details about the supported query strings, access the [wiki](https://github.com/nutes-uepb/query-strings-parser/wiki/3.-Supported-Query-Strings) page.
117
-
118
-
## New Features
119
-
- Support for parser functions. For informations and details about parser functions, access the [wiki](https://github.com/nutes-uepb/query-strings-parser/wiki/4.-Parsers) page.
120
235
121
-
## Future Features
122
-
- ¹Support for relational databases such as MySQL, PostgreSQL and SQLite.
236
+
----------
237
+
238
+
### Future Features
239
+
- ¹Support for relational databases such as MySQL, PostgreSQL and SQLite.
240
+
123
241
124
242
[//]: #(These are reference links used in the body of this note.)
0 commit comments