Skip to content

Commit

Permalink
Add noOpen option to connect().
Browse files Browse the repository at this point in the history
This is useful for connect-mongo, which does not interface well with
asyncronous instantiation.
  • Loading branch information
sethml committed Jul 27, 2011
1 parent b5997be commit 5664e05
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/mongodb/db.js
Expand Up @@ -772,6 +772,9 @@ exports.connect = function(url, options, callback) {
}

var db = new Db(dbname, server, dbOptions);
if (options.noOpen)
return db;

db.open(function(err, db){
if(!err && authPart){
db.authenticate(auth[0], auth[1], function(err, success){
Expand Down

0 comments on commit 5664e05

Please sign in to comment.