简体   繁体   English

弃用警告:不推荐使用当前的服务器发现和监控引擎

[英]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.

相关问题 服务器发现和监控引擎已弃用 - Server Discovery And Monitoring engine is deprecated 弃用警告过程。不推荐使用EventEmitter - DeprecationWarning process.EventEmitter is deprecated 弃用警告:不推荐使用未处理的承诺拒绝 - DeprecationWarning: Unhandled promise rejections are deprecated webpack 3 DeprecationWarning:不推荐使用Chunk.modules - webpack 3 DeprecationWarning: Chunk.modules is deprecated (node:5132)DeprecationWarning:不推荐使用`DEBUG_FD`。 与bodyParser - (node:5132) DeprecationWarning: `DEBUG_FD` is deprecated. with bodyParser DeprecationWarning:使用AWS JS SDK不建议调用不带回调的异步函数 - DeprecationWarning: Calling an asynchronous function without callback is deprecated with AWS JS SDK (node:25372) DeprecationWarning:消息事件已被弃用。 改用 messageCreate - (node:25372) DeprecationWarning: The message event is deprecated. Use messageCreate instead (节点:93364)[DEP0018] DeprecationWarning:不推荐使用未处理的 promise 拒绝 - (node:93364) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated 错误:弃用警告:未处理的 promise 拒绝已弃用。 - 承诺在 Javascript 和 Selenium - Error: DeprecationWarning: Unhandled promise rejections are deprecated. - Promises in Javascript with Selenium App引擎RPC发现文档 - App engine RPC discovery doc
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM