# mongo-writable-stream

> Writable stream that inserts or updates MongoDB documents

Latest version **0.2.0** (published 2017-11-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install mongo-writable-stream
pnpm add mongo-writable-stream
yarn add mongo-writable-stream
bun add mongo-writable-stream
```

## 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.2.0 |
| Published | 2017-11-08 |
| First published | 2014-05-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Author | Michael Dellanoce |
| Maintainers | joelsherriff, mdellanoce |
| Keywords | mongodb, writable, stream |

## Links

- npm: https://www.npmjs.com/package/mongo-writable-stream
- Repository: https://github.com/RallySoftware/node-mongo-writable-stream
- Issues: https://github.com/RallySoftware/node-mongo-writable-stream/issues
- npm.io page: https://npm.io/package/mongo-writable-stream

## Dependencies (1)

- [mongodb](https://npm.io/package/mongodb.md) ~2.2.19

## 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.2.0 (latest) — 2017-11-08
- 0.1.2 — 2014-09-11
- 0.1.1 — 2014-05-08
- 0.1.0 — 2014-05-06

## README

# MongoWritableStream

A writable stream that inserts or updates MongoDB documents.

# Usage

## Insert

    var MongoWritableStream = require('mongo-writable-stream');

    var stream = new MongoWritableStream({
    	url: 'mongodb://localhost/yourdb',
    	collection: 'yourcollection'
    });

    stream.write({ name: 'testdoc' });
    stream.end();

## Update

    var MongoWritableStream = require('mongo-writable-stream');

    var stream = new MongoWritableStream({
    	url: 'mongodb://localhost/yourdb',
    	collection: 'yourcollection',
    	upsert: true,
    	upsertFields: ['name'] //Optional, defaults to _id
    });

    stream.write({ name: 'testdoc', value: 42 });
    stream.end();

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