# dbstream-mongo

> Mongo DB access layer compatible with the Database Stream API

Latest version **2.0.0** (published 2018-07-23) · MIT license · 0 weekly downloads

## Install

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

## 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 | 2.0.0 |
| Published | 2018-07-23 |
| First published | 2015-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 16.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Roi Avinoam |
| Maintainers | avinoamr |
| Keywords | database, mongo, mongodb, stream, dbstream, api |

## Links

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

## Dependencies (3)

- [extend](https://npm.io/package/extend.md) ^3.0.0
- [mongodb](https://npm.io/package/mongodb.md) ^3.1.1
- [dbstream](https://npm.io/package/dbstream.md) ^1.0.1

## 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

- 2.0.0 (latest) — 2018-07-23
- 1.4.1 — 2016-12-24
- 1.4.0 — 2016-12-14
- 1.3.11 — 2016-11-11
- 1.3.10 — 2016-08-18
- 1.3.9 — 2016-07-03
- 1.3.8 — 2015-10-17
- 1.3.6 — 2015-09-29
- 1.3.5 — 2015-08-04
- 1.3.4 — 2015-08-04
- 1.3.3 — 2015-08-01
- 1.3.2 — 2015-07-29
- 1.2.1 — 2015-07-28
- 1.1.0 — 2015-07-12
- 1.0.2 — 2015-06-28
- … 1 more at https://npm.io/package/dbstream-mongo/versions

## README

dbstream-mongo
==============

Mongo DB access layer compatible with the [dbstream](https://github.com/avinoamr/dbstream) API

### Usage

```javascript
var db = require( "dbstream-mongo" );
var connection = db.connect( "mongodb://127.0.0.1:27017/test", { collection: "test" } );

// write or update
var cursor = new connection.Cursor()
cursor.write({ id: 1, name: "Hello" });
cursor.write({ id: 2, name: "World" });
cursor.on("finish", function() {
  console.log("Saved 2 objects");
});
cursor.end();

// read
new connection.Cursor()
  .find({ id: 2 })
  .limit( 1 )
  .on("data", function (obj) {
    console.log("Loaded", obj);
  });
```

### API

This module implements the [dbstream](https://github.com/avinoamr/dbstream) API. For the complete documention see: https://github.com/avinoamr/dbstream

###### connect( url, options )

* `url` a mongodb connection url string
* `options` standard mongodb connection options, plus a `collection` name key
* Returns a dbstream [Connection](https://github.com/avinoamr/dbstream#connection) object

Creates a MongoDB connection. Uses the [MongoClient.connect](http://mongodb.github.io/node-mongodb-native/api-generated/mongoclient.html#mongoclient-connect) arguments.

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