diff --git a/lib/utils.js b/lib/utils.js index 63377c47..1e6f1ff3 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -183,7 +183,8 @@ function compareUris(uri1, uri2) { */ function getDatabase(obj) { // If the object has a db property should be a mongoose connection instance - if (obj.db) { + // Mongo 2 has a db property but its a function. See issue #14 + if (obj.db && typeof obj.db !== 'function') { return obj.db; } // If it has a connection property with a db property on it is a mongoose instance