diff --git a/lib/persistence/mongo.js b/lib/persistence/mongo.js index 1bbc0c2..183ed18 100644 --- a/lib/persistence/mongo.js +++ b/lib/persistence/mongo.js @@ -26,8 +26,6 @@ OTHER DEALINGS IN THE SOFTWARE. var AbstractPersistence = require("./abstract"); var escape = require('escape-string-regexp'); -var mongo = require('mongodb'); -var MongoClient = mongo.MongoClient; var util = require("util"); var steed = require("steed")(); var Matcher = require("./matcher"); @@ -167,6 +165,8 @@ function MongoPersistence(options, done) { if (options.connection) { connected(null, this.options.connection); } else { + var mongo = require('mongodb'); + var MongoClient = mongo.MongoClient; MongoClient.connect(this.options.url, this.options.mongo, connected); } }