0.1.4 • Published 9 years ago

mongo-watcher v0.1.4

Weekly downloads
-
License
MIT
Repository
-
Last release
9 years ago

Listen for changes in Mongodb

Either replication must be set up or mongo must be configured as master.

mongod --master

Example: Listen to changes from all databases and collections.

var listener = require('mongo-watcher');

var changeStream = listener.listen();

changeStream.on('data', function(data) {
  console.log(data);
});

Listen to changes on all collections in a specific database:

var listener = require('mongo-watcher');

var options = {
  database: 'logging'
};

var changeStream = listener.listen(options);

changeStream.on('data', function(data) {
  console.log(data);
});

Stream values:

  {
    operation: 'insert',
    db: 'files',
    collection: 'files',
    _id: 55fbd8665e494b42032a76a6
  }
0.1.4

9 years ago

0.1.3

9 years ago

0.1.2

9 years ago

0.1.1

9 years ago

0.0.1

9 years ago