I mongod, nodejs, and download mongo-oplog. My replication is set is working on my computer .I have tried to run a replication set on my computer ,while I try to access it from node.js but I still nothing. Am I missing a piece of code ?
var MongoOplog = require('mongo-oplog');
var oplog = MongoOplog('mongodb://127.0.0.1:27017/local', { ns: 'test.posts' }).tail();
console.log("Please Work");
oplog.on('op', function (data) {
console.log(data);
});