# mongobus

> MongoDB as a Message Bus

Latest version **0.5.6** (published 2012-10-09) · 0 weekly downloads

## Install

```sh
npm install mongobus
pnpm add mongobus
yarn add mongobus
bun add mongobus
```

## 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.5.6 |
| Published | 2012-10-09 |
| First published | 2012-09-23 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 0.6.12 |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+13 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Van Nguyen |
| Maintainers | thegoleffect |

## Links

- npm: https://www.npmjs.com/package/mongobus
- Repository: https://github.com/thegoleffect/mongobus
- npm.io page: https://npm.io/package/mongobus

## Dependencies (4)

- [mongodb](https://npm.io/package/mongodb.md) ~1.1.8
- [mongoose](https://npm.io/package/mongoose.md) 2.5.11
- [underscore](https://npm.io/package/underscore.md) 1.3.1
- [coffee-script](https://npm.io/package/coffee-script.md) 1.2.0

## Recent versions

- 0.5.6 (latest) — 2012-10-09
- 0.5.5 — 2012-10-09
- 0.5.4 — 2012-10-09
- 0.5.3 — 2012-10-09
- 0.5.3-pre — 2012-10-09
- 0.5.2 — 2012-10-01
- 0.5.1 — 2012-10-01
- 0.0.1 — 2012-09-23

## README

Mongobus
========

Install:

    npm install mongobus


Use:

    var Mongobus = require("mongobus")
    
    var mbus = new Mongobus("mongodb://localhost/test")
    mbus.channel("mbus")
    
    mbus.subscribe({signin: 1}, function(err, doc){
      // do stuff with doc
    })
    
    mbus.publish({signin: 1, ts: Date.now(), moredata: {x:1}}, function(err){
      // published
    })
    
    mbus.create(channelName, {size: 10000000}, function(err, channel){
        // mongobus capped collection created for you
    })
    
    mbus.drop(channelName, function(err){
        // channelName collection dropped 
    })
    
    mbus.index({signin: 1}, options, function(err){
        // index created (uses Schema)
    })


## Note

Mongobus uses an abstracted, flexible Schema for storing the data and associated metadata. So if you tried to insert `{signin: 1, ts: Date.now()}` directly, it would not be detected by mbus.`subscribe({signin:1})`. Please use `mbus.publish({siginin: 1, ts: Date.now()})` instead.

Aggregations & Alerts have been removed until they can be properly ported from the other repos.

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