Skip to content

Commit

Permalink
BUGFIX: Switching to createConnection fixes #4
Browse files Browse the repository at this point in the history
  • Loading branch information
mryellow committed Aug 17, 2020
1 parent c195f4d commit 071b106
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Expand Up @@ -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},
Expand Down

0 comments on commit 071b106

Please sign in to comment.