cayasso / mongo-oplog

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

How to listen to two collections with one oplog #38

Closed jbockerstette closed 8 years ago

jbockerstette commented 8 years ago

I want to monitor two collections. My collections are Apple.rpps and Apple.dps. If I want to monitor one collection I would do this:

oplog = MongoOplog('mongodb://127.0.0.1:27017/local', {ns: 'Apple.rpps'}).tail();

How can I change this statement to monitor both collections?

cayasso commented 8 years ago

@jbockerstette you can do:

oplog = MongoOplog('mongodb://127.0.0.1:27017/local', {ns: 'Apple.*ps'}).tail();