# digger-mongo

> Mongo supplier for digger

Latest version **0.1.1** (published 2016-06-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install digger-mongo
pnpm add digger-mongo
yarn add digger-mongo
bun add digger-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.1.1 |
| Published | 2016-06-02 |
| First published | 2013-08-13 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 7 |
| Known vulnerabilities | 0 (+5 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kai Davenport |
| Maintainers | binocarlos |
| Keywords | digger, mongo |

## Links

- npm: https://www.npmjs.com/package/digger-mongo
- Repository: https://github.com/binocarlos/digger-mongo
- Homepage: https://github.com/binocarlos/digger-mongo#readme
- Issues: https://github.com/binocarlos/digger-mongo/issues
- npm.io page: https://npm.io/package/digger-mongo

## Dependencies (7)

- [async](https://npm.io/package/async.md) ~0.2.9
- [lodash](https://npm.io/package/lodash.md) ~1.3.1
- [mongodb](https://npm.io/package/mongodb.md) ^2.1.21
- [digger-utils](https://npm.io/package/digger-utils.md) ~1.0.7
- [digger-selector](https://npm.io/package/digger-selector.md) 0.0.8
- [digger-supplier](https://npm.io/package/digger-supplier.md) ~0.1.0
- [digger-nestedset](https://npm.io/package/digger-nestedset.md) ~0.0.2

## 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
- [btrz-health-check](https://npm.io/package/btrz-health-check.md) — 474 weekly downloads

## Recent versions

- 0.1.1 (latest) — 2016-06-02
- 0.1.0 — 2014-03-14
- 0.0.23 — 2014-02-25
- 0.0.22 — 2013-10-10
- 0.0.21 — 2013-10-10
- 0.0.20 — 2013-09-08
- 0.0.19 — 2013-09-07
- 0.0.18 — 2013-09-04
- 0.0.17 — 2013-09-03
- 0.0.15 — 2013-09-03
- 0.0.14 — 2013-09-03
- 0.0.13 — 2013-09-03
- 0.0.11 — 2013-09-02
- 0.0.10 — 2013-09-02
- 0.0.9 — 2013-09-02
- … 5 more at https://npm.io/package/digger-mongo/versions

## README

digger-mongo
============

Mongo supplier for digger

## installation

	$ npm install digger-mongo

## usage

This library allows you to save digger databases into MongoDB.

```
var Mongo = require('digger-mongo');

// create the supplier
var supplier = Mongo({
	hostname:'127.0.0.1',
  port:27017,
  database:'mydb',
  collection:'mycollection',
  reset:false,
  nocache:false
})

// run a request against the supplier
supplier({
	method:'get',
	url:'/selector'
}, function(error, answer){
	console.log('-------------------------------------------');
	console.log('we have loaded the selector via REST');
})

```

## provisioning

Sometimes it is useful for a supplier to provision the database and/or collection depending upon the url of the request.

For example - imagine I mounted a Mongo supplier onto:

	/mymongosupplier

If I configure it with a specific database and collection then there is no provisioning required - because I have statically assigned what database and collection.

However - if I only configure the database property and leave the collection for provisioning - it will use the url of the request to decide what collection to use:

```js
var supplier = Mongo({
	database:'mydb',
	provision:['collection']
})

supplier({
	method:'get',
	url:'/database_mount/db1234'
}, function(error, result){

})	
```

This allocates **db1234** as the collection name

## licence

MIT

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