Gathering detailed insights and metrics for qproc-mongo-qs
Gathering detailed insights and metrics for qproc-mongo-qs
Gathering detailed insights and metrics for qproc-mongo-qs
Gathering detailed insights and metrics for qproc-mongo-qs
Creates url encoded query strings that are compatible with qproc-mongo.
npm install qproc-mongo-qs
Typescript
Module System
Node Version
NPM Version
TypeScript (92.72%)
JavaScript (7.28%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
21 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Sep 01, 2019
Latest Version
1.2.0
Package Id
qproc-mongo-qs@1.2.0
Unpacked Size
15.01 kB
Size
4.18 kB
File Count
9
NPM Version
5.6.0
Node Version
8.11.3
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
2
Targets ES5+
Provides a query string builder class to create url encoded query strings that are compatible with qproc-mongo.
1npm i -S qproc-mongo-qs
1const { QSBuilder } = require("qproc-mongo-qs"); 2const qs = new QSBuilder(); 3 4qs.limit(100) 5 .skip(0) 6 .sort("timestamp", -1); 7 8qs.prop("word").in("one", "two", "three"); 9qs.prop("value") 10 .gt(10) 11 .lte(20); 12qs.prop("nested.status").ne("active"); 13qs.prop("text").regex(/^[A-z0-9]/); 14 15console.log(qs.toString()); 16 17/* 18 19limit=100&sort=desc:timestamp&word=in:one,two,three&value=gt:10,lte:20&nested.status=ne:active&text=regex:/%5E[A-z0-9]/ 20 21*/ 22 23const uri = `https://rest-api.com/api/items?${qs.toString()}`;
The limit
, skip
, sort
, and search
keys should match the keys qproc-mongo
is configured with. The defaults match the qproc-mongo
defaults.
Key | Default | Description | Example |
---|---|---|---|
limit | limit | The maximum number of records to return. | qs.limitKey('count') |
skip | skip | The number of records to skip. | qs.skipKey('offset') |
sort | sort | The sort property name(s) and order(s). | qs.sortKey('orderBy') |
search | search | The search term. | qs.searchKey('q') |
1const { QSBuilder } = require("qproc-mongo-qs"); 2 3const qs = new QSBuilder(); 4qs.limitKey("count") 5 .skipKey("offset") 6 .sortKey("orderBy") 7 .searchKey("q") 8 .limit(10) 9 .sort("value", 1); 10 11qs.prop("value") 12 .gt(1) 13 .lte(10); 14 15console.log(qs.toString()); 16 17/* 18 19count=10&orderBy=asc:value&value=gt:1,lte:10 20 21*/
The limit
method expects a positive Number
argument and returns the QSBuilder
so that calls are chainable.
The skip
method expects a positive Number
argument and returns the QSBuilder
so that calls are chainable.
The sort
method expects a property name
and a numerical direction
as arguments. It can be called multiple times with different property name
values for complex sorts. Returns the QSBuilder
so that calls are chainable.
Direction | Sort Order | Example |
---|---|---|
-1 | Descending | qs.sort('timestamp', -1) |
1 | Ascending | qs.sort('timestamp', 1) |
The search
method expects a String
or Number
. As stated in the qproc-mongo
documentation, when a search key is present in the query parameters, all other query parameters are ignored. See the qproc-mongo documentation for more info. Returns the QSBuilder
so that calls are chainable.
The prop
method expects a property name
argument and returns a QSParam
. The prop
exposes the following operator functions. The operator functions return the QSParam
for chaining.
Function | Argument Type | Description | Example |
---|---|---|---|
eq | String | Number | Equal. | prop('key').eq('value') |
ne | String | Number | Not equal. | prop('key').ne('value') |
in | String | Number | In the list of values. Accepts any number of arguments. | prop('key').in(1,2,3,4) |
nin | String | Number | Not in the list of values. Accepts any number of arguments. | prop('key').nin(1,2,3,4) |
gt | String | Number | Greater than. | prop('key').gt(1) |
gte | String | Number | Greater than or equal to. | prop('key').gte(1) |
lt | String | Number | Less than. | prop('key').lt(1) |
lte | String | Number | Less than or equal to. | prop('key').lte(1) |
all | String | Number | Contains all values. Accepts any number of arguments. | prop('key').all(1,2,3,4) |
regex | String | RegExp | Match regular expression. | prop('key').regex(/^A-z/) |
Calling the same operator method on the same prop
multiple times will overwrite the previous value.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
no SAST tool detected
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
Found 0/21 approved changesets -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More