[英]DeprecationWarning: current Server Discovery and Monitoring engine is deprecated
I know, I know the problem has been has been solved except, it hasn't.我知道,我知道问题已经解决了,但还没有。
I'm running:我在跑:
mongoose 5.8.4 and nodemon 2.0.2 in case it's relevant. mongoose 5.8.4 和 nodemon 2.0.2 以防万一。
const mongoose = require('mongoose');
const config = require('config');
const db = config.get('mongoURI');
const connectDB = () => {
mongoose
.connect(db, {
useNewUrlParser: true,
useCreateIndex: true,
useFindAndModify: false
// useUnifiedTopology: true
})
.then(() => console.log('MongoDB connected!'))
.catch(err => {
console.error(err.msg);
process.exit(1);
});
};
module.exports = connectDB;
When I run the server with useUnifiedTopology: true
after 30 or so seconds a msg shows up saying:当我使用
useUnifiedTopology: true
在 30 秒左右后运行服务器时, useUnifiedTopology: true
一条消息:
[nodemon] app crashed - waiting for file changes before starting... [nodemon] 应用程序崩溃 - 在开始之前等待文件更改...
Any ideas on how to fix this bug?关于如何修复此错误的任何想法?
Created a new cluster on Atlas and everything works fine.在 Atlas 上创建了一个新集群,一切正常。 Thanks anyways, guys.
无论如何,谢谢,伙计们。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.