Skip to content

Commit 474ac65

Browse files
committed
fix(mongo-client): options should not be passed to connect
Passing `options` to the `connect` object for parsed topologies in `createServer` effectively overrides the options that were originally passed into the client. NODE-1132
1 parent 9fb3d86 commit 474ac65

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

lib/mongo_client.js

+8-5
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,12 @@ var validOptionNames = [
8282
'user',
8383
'password',
8484
'authMechanism',
85-
'compression'
85+
'compression',
86+
'fsync',
87+
'readPreferenceTags',
88+
'numberOfRetries',
89+
'autoReconnect',
90+
'auto_reconnect'
8691
];
8792

8893
var ignoreOptionNames = ['native_parser'];
@@ -610,13 +615,11 @@ function createServer(self, options, callback) {
610615
// Set default options
611616
var servers = translateOptions(options);
612617

613-
console.log(servers[0].s.clonedOptions);
614-
console.log(servers[0].s.options);
615-
616618
// Propegate the events to the client
617619
var collectedEvents = collectEvents(self, servers[0]);
620+
618621
// Connect to topology
619-
servers[0].connect(options, function(err, topology) {
622+
servers[0].connect(function(err, topology) {
620623
if (err) return callback(err);
621624
// Clear out all the collected event listeners
622625
clearAllEvents(servers[0]);

0 commit comments

Comments
 (0)