# restful-mongo

> Add easily RESTful API to use with Mongo

Latest version **0.4.3** (published 2015-04-26) · BSD license · 0 weekly downloads

## Install

```sh
npm install restful-mongo
pnpm add restful-mongo
yarn add restful-mongo
bun add restful-mongo
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.3 |
| Published | 2015-04-26 |
| First published | 2013-04-17 |
| Weekly downloads | 0 |
| License | BSD |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | bitliner |
| Maintainers | bitliner |
| Keywords | mongo, mongodb, api, rest, restful, crud |

## Links

- npm: https://www.npmjs.com/package/restful-mongo
- Repository: https://github.com/bitliner/restful-mongo
- Issues: https://github.com/bitliner/restful-mongo/issues
- npm.io page: https://npm.io/package/restful-mongo

## Dependencies (7)

- [logb](https://npm.io/package/logb.md) 0.0.2
- [async](https://npm.io/package/async.md) ^0.9.0
- [which](https://npm.io/package/which.md) ^1.0.9
- [lodash](https://npm.io/package/lodash.md) ^3.7.0
- [mongodb](https://npm.io/package/mongodb.md) >= 0.9.2
- [request](https://npm.io/package/request.md) ~2.33.0
- [deferred](https://npm.io/package/deferred.md) ~0.6.4

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 0.4.3 (latest) — 2015-04-26
- 0.4.1 — 2015-04-26
- 0.4.0 — 2015-04-26
- 0.3.9 — 2015-04-25
- 0.3.8 — 2015-04-25
- 0.3.7 — 2014-02-19
- 0.3.6 — 2014-02-17
- 0.3.5 — 2013-11-24
- 0.3.4 — 2013-11-05
- 0.3.3 — 2013-10-24
- 0.3.2 — 2013-10-24
- 0.3.1 — 2013-10-24
- 0.3.0 — 2013-10-24
- 0.2.8 — 2013-10-24
- 0.2.7 — 2013-10-24
- … 27 more at https://npm.io/package/restful-mongo/versions

## README

RESTful MongoDB
============================

It allows you to setup an HTTP API server to access data stored on MongoDB, easily and quickly.


# Install and setup an express server using restful-mongo

* `npm install -g express-generator`
* `express mongo-express` 
* `cd mongo-express && npm install`
* `npm install --save restful-mongo` to install *restful-mongo*
* add to *app.js* file, in the section where routes are configured, the following code

```
var RestfulMongo=require('restful-mongo');
new RestfulMongo({
    HOST:'localhost',   // host of mongodb server, OPTIONAL
    PORT:27017          // port of mongodb server, OPTIONAL  
}).configure(app);
```

* `npm start`
* access browser at `http://localhost:3000/api/test/collectionName` to read JSON documents of collection  *collectionName* of database *test1*



# Example of HTTP requests

**You can do following requests**:	


 > ```
 > GET /api/localhost:27017/test1/collections HTTP/1.1
 > ```
 >
 > <big>Get list of collection names of *test1* database </big>

<br>

 >```
 >GET /api/localhost:27017/test1/books HTTP/1.1
 >```
 >
 ><big>Get all documents of collection *books* of *test1* database </big>

<br>

 >```
 >GET /api/localhost:27017/test1/books?rawQuery={author:{$in:['Manzoni']}} HTTP/1.1
 >```
 >
 ><big>Get all documents of collection *books* of *test1* database whose author is *Manzoni*</big>


# Disclaimer

* the code behind this module is very old, not so readable, and needs refactoring. Do not consider this code as code that I usually write.

---
_Source: https://npm.io/package/restful-mongo · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
