在编译我的 Node-Mongoose (NextJS) 应用程序时,我不断收到以下错误:
DeprecationWarning: Mongoose: mpromise (mongoose 的默认承诺库) 已被弃用,请插入您自己的承诺库: http ://mongoosejs.com/docs/promises.html
我已经有了 bluebird promise 引擎,但我想不出我错过的任何其他东西。我的服务器文件具有以下声明(当然还有其他声明):
const mongoose = require('mongoose');
const bluebird = require('bluebird');
mongoose.Promise = bluebird;
mongoose.connect(process.env.MONGO_PATH, {
useMongoClient: true,
promiseLibrary: bluebird
});
我的模型文件有以下内容:
const mongoose = require('mongoose');
mongoose.Promise = require('bluebird');
const Schema = mongoose.Schema;
const passportLocalMongoose = require('passport-local-mongoose');
我错过了什么?