Skip to content
This repository has been archived by the owner on Feb 4, 2022. It is now read-only.

Commit

Permalink
feat(sdam): backport unified SDAM changes from next to master
Browse files Browse the repository at this point in the history
The unified SDAM will be shipped in v3.2.0 now, so this brings the
changes over the past four months into `master` for that release.
  • Loading branch information
mbroadst committed Feb 25, 2019
1 parent be884c2 commit 83d744c
Show file tree
Hide file tree
Showing 56 changed files with 1,803 additions and 1,061 deletions.
1 change: 1 addition & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ module.exports = {
Sessions: require('./lib/sessions'),
BSON: BSON,
EJSON: EJSON,
Topology: require('./lib/sdam/topology'),
// Raw operations
Query: require('./lib/connection/commands').Query,
// Auth mechanisms
Expand Down
2 changes: 1 addition & 1 deletion lib/connection/connect.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ function performInitialHandshake(conn, options, callback) {
options.port +
' reports wire version ' +
(ismaster.maxWireVersion || 0) +
', but this version of Node.js Driver requires at least ' +
', but this version of the Node.js Driver requires at least ' +
latestSupportedMaxWireVersion +
' (MongoDB' +
latestSupportedVersion +
Expand Down
21 changes: 21 additions & 0 deletions lib/connection/pool.js
Original file line number Diff line number Diff line change
Expand Up @@ -742,6 +742,27 @@ Pool.prototype.destroy = function(force) {
checkStatus();
};

/**
* Reset all connections of this pool
*
* @param {function} [callback]
*/
Pool.prototype.reset = function(callback) {
// this.destroy(true, err => {
// if (err && typeof callback === 'function') {
// callback(err, null);
// return;
// }

// stateTransition(this, DISCONNECTED);
// this.connect();

// if (typeof callback === 'function') callback(null, null);
// });

if (typeof callback === 'function') callback();
};

// Prepare the buffer that Pool.prototype.write() uses to send to the server
function serializeCommand(self, command, callback) {
const originalCommandBuffer = command.toBin();
Expand Down
Loading

0 comments on commit 83d744c

Please sign in to comment.