# dpd-filebased-mongodb

> run deployd without mongodb (but a jsonfile instead to store data)

Latest version **1.2.8** (published 2016-12-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install dpd-filebased-mongodb
pnpm add dpd-filebased-mongodb
yarn add dpd-filebased-mongodb
bun add dpd-filebased-mongodb
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.8 |
| Published | 2016-12-16 |
| First published | 2016-11-19 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | coderofsalvation |
| Keywords | filebased, mongo, json, flatfile, memory |

## Links

- npm: https://www.npmjs.com/package/dpd-filebased-mongodb
- Repository: https://www.github.com/coderofsalvation/dpd-filebased-mongodbs
- npm.io page: https://npm.io/package/dpd-filebased-mongodb

## Dependencies (2)

- [debug](https://npm.io/package/debug.md) ^2.3.3
- [monkeypatch](https://npm.io/package/monkeypatch.md) ^1.0.0

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.2.8 (latest) — 2016-12-16
- 1.2.7 — 2016-12-16
- 1.2.6 — 2016-12-14
- 1.2.5 — 2016-12-14
- 1.2.4 — 2016-12-11
- 1.2.3 — 2016-12-11
- 1.2.2 — 2016-12-10
- 1.2.1 — 2016-12-07
- 1.2.0-t — 2016-11-19
- 1.1.9 — 2016-11-19
- 1.1.8 — 2016-11-19
- 1.1.7 — 2016-11-19

## README

run deployd without mongodb (but a jsonfile instead to store data)

<img src="https://media0.giphy.com/media/3o7TKDMPKsakcn9NU4/200.gif" width="150" style="width:150px"/>

## Usage 

    $ npm install dpd-filebased-mongodb mongo-mock --save
    $ mkdir data
    $ export MONGO_DB_FILE=data/mongo.js
    $ node app.js

Now make sure you include it *before* deployd itself in your `app.js`:

		require('dpd-filebased-mongodb')           // <-- magic right there
		var deployd = require('deployd')
		var dpd = deployd({port:3000});
		dpd.listen();

> That's it! Now your data is stored in `data/mongodb.js` 

## Why 

* Sometimes you want to use deployd for simple api's without the mongodb-requirement.
* Sometimes you want to test deployd with a fake mongodb

## Notes 

* to specify a different dbfile, specify environment variable `MONGO_DB_FILE="data/foo.js"` etc
* it doesn't run *all* mongo-queries, see [mongo-mock](https://npmjs.org/package/mongomock)
* because of this, `hide(field)` doesn't always work (solution: put `if( this.password ) delete this.password` into event-code)

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