mongo-oplog icon indicating copy to clipboard operation
mongo-oplog copied to clipboard

Updates to node-mongodb-native 3.3.3

Open peterbroadhurst opened this issue 5 years ago • 1 comments

In order to pick up a fix for https://www.npmjs.com/advisories/1203 we wanted to update the mongodb version.

There were a couple of changes needed with the latest client:

  • Needed to call db() to get the default DB object from the URI
    • http://mongodb.github.io/node-mongodb-native/3.1/api/MongoClient.html#db
  • The close() needs to be on the client, not the db
  • nextObject() has been renamed to next() on the cursor.
  • We saw "op":"c" events ahead of the "op":"i"

peterbroadhurst avatar Oct 19 '19 03:10 peterbroadhurst

@peterbroadhurst thanks for this PR! This driver upgrade fixes an issue I had with connecting to the oplog on a 3.6 Atlas cluster. The problem I ran into is my connection string would specify the local database but the connection would still go to the admin database and it tried to execute the oplog queries there 🤦‍♂. It seems the new mongo driver has fixed this issue and mongo-oplog correctly connects to local.

It would be 💯to get this merged soon so I don't have to point our package.json at a fork.

QuotableWater7 avatar Oct 30 '19 18:10 QuotableWater7