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

Commit 83d744c

Browse files
committed
feat(sdam): backport unified SDAM changes from next to master
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.
1 parent be884c2 commit 83d744c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+1803
-1061
lines changed

index.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ module.exports = {
3333
Sessions: require('./lib/sessions'),
3434
BSON: BSON,
3535
EJSON: EJSON,
36+
Topology: require('./lib/sdam/topology'),
3637
// Raw operations
3738
Query: require('./lib/connection/commands').Query,
3839
// Auth mechanisms

lib/connection/connect.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ function performInitialHandshake(conn, options, callback) {
108108
options.port +
109109
' reports wire version ' +
110110
(ismaster.maxWireVersion || 0) +
111-
', but this version of Node.js Driver requires at least ' +
111+
', but this version of the Node.js Driver requires at least ' +
112112
latestSupportedMaxWireVersion +
113113
' (MongoDB' +
114114
latestSupportedVersion +

lib/connection/pool.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -742,6 +742,27 @@ Pool.prototype.destroy = function(force) {
742742
checkStatus();
743743
};
744744

745+
/**
746+
* Reset all connections of this pool
747+
*
748+
* @param {function} [callback]
749+
*/
750+
Pool.prototype.reset = function(callback) {
751+
// this.destroy(true, err => {
752+
// if (err && typeof callback === 'function') {
753+
// callback(err, null);
754+
// return;
755+
// }
756+
757+
// stateTransition(this, DISCONNECTED);
758+
// this.connect();
759+
760+
// if (typeof callback === 'function') callback(null, null);
761+
// });
762+
763+
if (typeof callback === 'function') callback();
764+
};
765+
745766
// Prepare the buffer that Pool.prototype.write() uses to send to the server
746767
function serializeCommand(self, command, callback) {
747768
const originalCommandBuffer = command.toBin();

0 commit comments

Comments
 (0)