From 071b106fd9eb7ab2e00e712103cf9f2a7756d802 Mon Sep 17 00:00:00 2001 From: Mr-Yellow Date: Tue, 18 Aug 2020 08:58:23 +1000 Subject: [PATCH] BUGFIX: Switching to createConnection fixes #4 --- index.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/index.js b/index.js index caebf92..b77351d 100644 --- a/index.js +++ b/index.js @@ -48,7 +48,7 @@ var lock = function(options) { // }}} .then(()=> mongoose.set('useFindAndModify', false)) .then(()=> mongoose.set('useCreateIndex', true)) - .then(()=> mongoose.connect(this.settings.mongodb.uri, this.settings.mongodb.options)) + .then(()=> mongoose.createConnection(this.settings.mongodb.uri, this.settings.mongodb.options)) .then(()=> this.schema = new mongoose.Schema({ key: {type: mongoose.Schema.Types.String, index: {unique: true}}, expiry: {type: mongoose.Schema.Types.Date},