This repository was archived by the owner on May 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +18
-3
lines changed
Expand file tree Collapse file tree 1 file changed +18
-3
lines changed Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ npm install mongo-querystring --save
3333var MongoQS = require (' mongo-querystring' );
3434```
3535
36- ### new MongoQS(` options ` )
36+ ### new MongoQS(` object ` options )
3737
3838* ` Array ` ops - list of supported operators
3939* ` object ` alias - query param aliases
@@ -42,9 +42,24 @@ var MongoQS = require('mongo-querystring');
4242
4343#### Custom query params
4444
45- ` TODO `
45+ Custom queries are on the folling form; you define the URL query parameter name
46+ that your users will be using and a function which takes the result query object
47+ and the value for query parameter.
4648
47- ### qs.parse(` params ` )
49+ ``` javascript
50+ qs = new MongoQS ({
51+ custom: {
52+ urlQueryParamName : function (query , input ) {
53+ // do some processing of input value
54+ // add your queries to the query object
55+ query[' someField' ] = input;
56+ query[' someOtherFiled' ] = ' some value' ;
57+ }
58+ }
59+ });
60+ ```
61+
62+ ### qs.parse(` object ` params)
4863
4964Params is an object with URI query params and their values. Ex. ` req.params `
5065if you are working with ExpressJS.
You can’t perform that action at this time.
0 commit comments