Skip to content

Commit d7be74f

Browse files
authored
Update db.js
fix: mongoose warning 'Error: (node:3819) DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead'
1 parent e425cbd commit d7be74f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

server/utils/db.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ function connect(callback) {
1616
mongoose.Promise = global.Promise;
1717

1818
let config = yapi.WEBCONFIG;
19-
let options = {useNewUrlParser: true };
19+
let options = {useNewUrlParser: true, useCreateIndex: true};
2020

2121
if (config.db.user) {
2222
options.user = config.db.user;

0 commit comments

Comments
 (0)