Skip to content

Commit

Permalink
chore!: removed deprecated code
Browse files Browse the repository at this point in the history
BREAKING CHANGE: `user` and `password` config properties are no longer
supported, this config should be placed at `auth` property

Signed-off-by: Antonio Ramón Sánchez Morales <[email protected]>
  • Loading branch information
arsa-dev committed Sep 3, 2022
1 parent 1874329 commit 01e7fc6
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
3 changes: 0 additions & 3 deletions lib/mongodb.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ const ObjectIdValueRegex = /^[0-9a-fA-F]{24}$/;
const ObjectIdTypeRegex = /objectid/i;

exports.ObjectID = ObjectID;
exports.ObjectId = ObjectID;
/*!
* Convert the id to be a BSON ObjectID if it is compatible
* @param {*} id The id value
Expand Down Expand Up @@ -284,8 +283,6 @@ MongoDB.prototype.connect = function(callback) {
'validateOptions',
'appname',
'auth',
// 'user', // no longer supported, only in `auth`
// 'password', // no longer supported , only in `auth`
'authMechanism',
'compression',
'readPreferenceTags',
Expand Down
10 changes: 1 addition & 9 deletions test/mongodb.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,22 +127,14 @@ describe('connect', function() {
if (err) return done(err);
const id = success.insertedId;
ds.connector.should.have.property('db');
// [NOTE] Now isDestroyed is completly removed at v4+ driver versions,
// see https://mongodb.github.io/node-mongodb-native/3.6/reference/unified-topology/
// ds.connector.db.should.have.property('topology');
// ds.connector.db.topology.should.have.property('isDestroyed');
// ds.connector.db.topology.isDestroyed().should.be.False();

ds.connector.disconnect(function(err) {
if (err) return done(err);
// [NOTE] isDestroyed() is not implemented by NativeTopology
// When useUnifiedTopology is true
// ds.connector.db.topology.isDestroyed().should.be.True();
ds.connector.execute('TestLazy', 'findOne', {_id: id}, function(
err,
data,
) {
if (err) return done(err);
// ds.connector.db.topology.isDestroyed().should.be.False();
done();
});
});
Expand Down

0 comments on commit 01e7fc6

Please sign in to comment.