We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
mongoosejs
Learn more about funding links in repositories.
Report abuse
1 parent 043c958 commit 352d80dCopy full SHA for 352d80d
lib/drivers/node-mongodb-native/connection.js
@@ -45,7 +45,13 @@ NativeConnection.prototype.__proto__ = MongooseConnection.prototype;
45
46
NativeConnection.prototype.doOpen = function(fn) {
47
var server = new Server(this.host, this.port, this.options.server);
48
- this.db = new Db(this.name, server, this.options.db);
+
49
+ if (this.options && this.options.mongos) {
50
+ var mongos = new Mongos([server], this.options.mongos);
51
+ this.db = new Db(this.name, mongos, this.options.db);
52
+ } else {
53
+ this.db = new Db(this.name, server, this.options.db);
54
+ }
55
56
var self = this;
57
this.db.open(function(err) {
0 commit comments