也不知道为什么报这个错误,网上查找的解决方法,加一行代码解决
命令行工具会提示如下信息:
DeprecationWarning: collection.ensureIndex is deprecated. Use createIndexes instead
解决方法:
//在连接数据库之前加上如下代码 mongoose.set('useCreateIndex', true)
本文分享自 作者个人站点/博客 前往查看
如有侵权,请联系 cloudcommunity@tencent.com 删除。
本文参与 腾讯云自媒体同步曝光计划 ,欢迎热爱写作的你一起参与!