oplog tailing DSL built on top of monk
MongoDB Oplog tailing DSL.
var oplog = require('oplog')('localhost:27017/local');
oplog.query({ i: /u|d/ });
oplog.filter()
.ns('*.users')
.on('update', function(){ });
.on('remove', function(){ });
oplog.tail();
op
event for each operation read with an object.Builds the tailer based on an existing monk
instance.
Builds the tailer by connecting to the given mongodb uri.
rs
and local
rs
if connected to multiple hosts, or local
otherwise.oplog
can't decide whether to tail the oplog.$main
or oplog.rs
{ ts: { $gt: { $timestamp: { t: <now>, i: 0 } } } }
Creates a new Filter
.
oplog
.update
, remove
, insert
events with each operation.Only emits the events for namespaces matching ns
pattern.
Shortcut for .ns('{db}.*')
.
Shortcut for .ns('*.{col}')
.
oplog must be used with mongodb 2.2.2+
Make sure to be running a replica set (which can be single-member) before executing
$ make test