【发布时间】:2022-02-25 18:16:43
【问题描述】:
const mongoose = require('mongoose');
mongoose.connect('mongodb://DATABASE_LOGIN1:[MyPass]@mee6copycluster-shard-00-00.r86qy.mongodb.net:27017/djsdashboard/?authSource=admin', {
useNewUrlParser: true,
useUnifiedTopology: true,
});
错误:UnhandledPromiseRejectionWarning: MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. Make sure your current IP address is on your Atlas cluster's IP whitelist
我不知道如何解决它请帮助
如果您想了解更多信息,请专门询问!
mongodb+srv://DATABASE_LOGIN1:[MyPass]@mee6copycluster-shard-00-00.r86qy.mongodb.net/admin?retryWrites=true&w=majority 给出错误:
(node:7288) UnhandledPromiseRejectionWarning: Error: querySrv ENOTFOUND _mongodb._tcp.mee6copycluster-shard-00-00.r86qy.mongodb.net
at QueryReqWrap.onresolve [as oncomplete] (dns.js:202:19)
(node:7288) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:7288) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
【问题讨论】:
-
您好,您的连接IP地址添加到IP访问列表了吗?
-
我确实添加了它,每个人都可以访问
-
在 mongodb Atlas @HELPME 中选择 3.6 或更高版本
-
我有ver 4.4.3
-
你好?哥们你还在吗?
标签: javascript mongodb