Skip to content

Commit

Permalink
use self to ensure proper scope of options in doOpenSet
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewjstone authored and aheckmann committed Aug 29, 2011
1 parent 926d433 commit 40c3f8f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/drivers/node-mongodb-native/connection.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,12 +68,13 @@ NativeConnection.prototype.doOpen = function (fn) {
*/

NativeConnection.prototype.doOpenSet = function (fn) {
var self = this;
if (!this.db) {
var servers = []
, ports = this.port;

this.host.forEach(function (host, i) {
servers.push(new mongo.Server(host, ports[i], this.options.server));
servers.push(new mongo.Server(host, ports[i], self.options.server));
});

var server = new ReplSetServers(servers, this.options.replset);
Expand Down

0 comments on commit 40c3f8f

Please sign in to comment.