cayasso / mongo-oplog

Watch mongodb oplog in a simple way
381 stars 91 forks source link

connecting to MongoOplog #17

Closed ORESoftware closed 9 years ago

ORESoftware commented 9 years ago

I have a typical local mongo database running at 127.0.0.1:27017/local

I am having trouble getting any info from it, with this setup:

var oplog = new MongoOplog('mongodb://127.0.0.1:27017/local','0').tail(function(err,oplogStream){
  console.log(oplogStream);
});

I guess I am not sure what to pass as my second argument to the MongoOplog constructor. None of my oplog.on() callbacks are firing. I want to listen to database 0, I guess, because that's only where the action is happening.

cayasso commented 9 years ago

Hey @ORESoftware did you setup replication on mongodb? Try running the test suite with replication, let me know if that is working for you.

ORESoftware commented 9 years ago

I was on Mongo 2.6, I switched to 3.0 and Mongo and this lib worked, thanks

cayasso commented 9 years ago

@ORESoftware awesome!!! but I am still wondering why it wouldn't work with 2.6. Any ideas?

ORESoftware commented 9 years ago

I am on Windows at home, and was doing this at home - once I moved from 2.6 to 3.0 on Windows it worked. I really didn't get any clues as to why though, if I find a clue, will share for sure.

cayasso commented 9 years ago

Ok np! BTW @ORESoftware I just released mongo-oplog@1.0.0-rc.1 your help testing would be much appreciated.

ORESoftware commented 9 years ago

for sure, will give you some feedback soon