报错信息
if (VALID_OPTIONS.indexOf(key) === -1) throw new Error(`\`${key}\` is an invalid option.`);
^
Error: `useCreateIndex` is an invalid option.
at Mongoose.set ... 此处省略一亿字
解决方案
useCreateIndex is no longer necessary in Mongoose 6, please remove it when you upgrade
Mongoose 6 不再需要 useCreateIndex,升级时请移除。
参考:https://github.com/Automattic/mongoose/issues/10732