Merge pull request #704 from lsqlebai/master

fix: mongoose warning 'Error:  (node:3819) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead'
This commit is contained in:
sean1025 2018-12-18 10:13:18 +08:00 committed by GitHub
commit 1c72a48091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -16,7 +16,7 @@ function connect(callback) {
mongoose.Promise = global.Promise;
let config = yapi.WEBCONFIG;
let options = {useNewUrlParser: true };
let options = {useNewUrlParser: true, useCreateIndex: true};
if (config.db.user) {
options.user = config.db.user;