diff --git a/lib/index.js b/lib/index.js index 1425cfac69a..547d809bb4a 100644 --- a/lib/index.js +++ b/lib/index.js @@ -4,16 +4,7 @@ * Module dependencies. */ -if (global.MONGOOSE_DRIVER_PATH) { - const deprecationWarning = 'The `MONGOOSE_DRIVER_PATH` global property is ' + - 'deprecated. Use `mongoose.driver.set()` instead.'; - const setDriver = require('util').deprecate(function() { - require('./driver').set(require(global.MONGOOSE_DRIVER_PATH)); - }, deprecationWarning); - setDriver(); -} else { - require('./driver').set(require('./drivers/node-mongodb-native')); -} +require('./driver').set(require('./drivers/node-mongodb-native')); const Document = require('./document'); const Schema = require('./schema'); @@ -732,19 +723,17 @@ Mongoose.prototype.connections; * Driver dependent APIs */ -const driver = global.MONGOOSE_DRIVER_PATH || './drivers/node-mongodb-native'; /*! * Connection */ - -const Connection = require(driver + '/connection'); +const Connection = require('./drivers/node-mongodb-native/connection'); /*! * Collection */ -const Collection = require(driver + '/collection'); +const Collection = require('./drivers/node-mongodb-native/collection'); /** * The Mongoose Aggregate constructor