Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit 391b0ab

Browse files
author
Hans Kristian Flaatten
committed
Add initial README
1 parent a545727 commit 391b0ab

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed

README.md

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
MongoDB QueryString [![Build Status](https://drone.io/github.com/Turistforeningen/node-mongo-querystring/status.png)](https://drone.io/github.com/Turistforeningen/node-mongo-querystring/latest)
2+
=====================
3+
4+
[![NPM](https://nodei.co/npm/mongo-querystring.png?downloads=true)](https://www.npmjs.org/package/mongo-querystring)
5+
6+
Accept MongoDB query parameters through URI queries safe and easy. This is
7+
useful when building an API and accepting various user specificed queries to
8+
your schema less database.
9+
10+
Allows you to specify you own custom query methods as well as accepting build
11+
in MongoDB basic operators such as `$ne`, `$gt`, `$lt`, `$regex`, `$exists` and
12+
build in support for advanced queries such as `$geoWithin` and `$near`.
13+
14+
## Install
15+
16+
```
17+
npm install mongo-querystring --save
18+
```
19+
20+
## API
21+
22+
```javascript
23+
var MongoQS = require('mongo-querystring');
24+
```
25+
26+
### new MongoQS(`options`)
27+
28+
* `Array` ops - list of supported operators
29+
* `object` alias - query param aliases
30+
* `object` ignore - ignored query params
31+
* `object` custom - custom query params
32+
33+
#### Custom query params
34+
35+
`TODO`
36+
37+
### qs.parse(`params`)
38+
39+
Params is an object with URI query params and their values. Ex. `req.params`
40+
if you are working with ExpressJS.
41+
42+
```javascript
43+
collection.find(qs.parse(params), field).toArray(function(err, documents) {
44+
// matching documents
45+
});
46+
```
47+

0 commit comments

Comments
 (0)