primus-mongodb
primus-mongodb
is a MongoDB store for Primus.
It takes care of distributing messages to other instances using MongoDB Pub/Sub.
Note: this is a very simple module for broadcasting all your messages over MongoDB to all connected clients.
Usage
You can use primus-mongodb
with a mongo url or mongo client.
var http = Primus = PrimusMongo = ; var server = http;var primus = server mongo: url: 'mongodb://localhost:27017/primus-test-db' // Or you could pass client: mongodb instance collection: 'primus-test' // optional, defaults to primus // You can also pass arguments to mubsub such as collection size or max documents transformer: 'websockets';primus; //// This'll take care of sending the message to all other instances connected// to the same Redis channel.//primus;
Inspired by primus-redis