0

I have an existing working node+mongodb+oplog application that pushes events to broswers via socket.io, on mongodb update. The configuration currently looks like this:

var oplog = MongoOplog('mongodb://' + config.dbHost + ':' + config.dbPort + '/local', { ns: config.dbName + '.obs_messages' }).tail();

I recently started using an actual replica set, where there is a primary and one secondary database machines. How would I change the configuration of MongoOplog in my node application to accommodate the change to multi-node replicaset?

Victor Pudeyev
  • 4,296
  • 6
  • 41
  • 67

1 Answers1

0

Yes the solution was this:

var oplog = MongoOplog('mongodb://10.0.0.1:27017,10.0.0.2:27017/local', { ns: config.dbName + '.collection_name' }).tail();
Victor Pudeyev
  • 4,296
  • 6
  • 41
  • 67