Skip to content

Commit

Permalink
Implement passing mongojs connections
Browse files Browse the repository at this point in the history
  • Loading branch information
saintedlama committed Oct 9, 2015
1 parent 143c836 commit 3a89ec7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,10 @@ var Database = function (connString, cols, options) {
this._getConnection = thunky(function (cb) {
mongodb.connect(connString, options, cb)
})
} else {
var connection = connString

// TODO: Check if the connection we got is already connected and connect if not!
this._getConnection = thunky(function (cb) {
cb(null, connection)
})
} else if (connString instanceof Database) { // mongojs
this._getConnection = connString._getConnection
} else { // try mongodb-native
// TODO: Implement mongodb connections
}

this.ObjectId = mongodb.ObjectId
Expand Down

0 comments on commit 3a89ec7

Please sign in to comment.