I'm trying to connect to my cluster on mongoDB Atlas via Mongoose.connect(), but every time i try to connect i get an exception "MongoError: authentication fail" I know MongoDB Atlas is new mongo as a service could it be not supported by mongoose yet?.
我正在尝试通过Mongoose.connect()连接到mongoDB Atlas上的集群,但是每次我尝试连接时都会遇到异常“MongoError:身份验证失败”我知道MongoDB Atlas是新的mongo,因为服务可能不是由猫鼬支持了吗?
1 个解决方案
#1
0
The answer in this related post is correct. You should:
这篇相关文章的答案是正确的。你应该:
- not mix options with connection string (if done so)
- make sure your IP you are running on is whitelisted and your network allows connections to Atlas
- make sure the user has sufficient permissions
-
use the connection string as is provided by atlas and just provide it to
使用atlas提供的连接字符串并将其提供给
mongoose.connect(uri);
不要将选项与连接字符串混合(如果这样做)
确保您运行的IP已列入白名单,并且您的网络允许连接到Atlas
确保用户具有足够的权限
#1
0
The answer in this related post is correct. You should:
这篇相关文章的答案是正确的。你应该:
- not mix options with connection string (if done so)
- make sure your IP you are running on is whitelisted and your network allows connections to Atlas
- make sure the user has sufficient permissions
-
use the connection string as is provided by atlas and just provide it to
使用atlas提供的连接字符串并将其提供给
mongoose.connect(uri);
不要将选项与连接字符串混合(如果这样做)
确保您运行的IP已列入白名单,并且您的网络允许连接到Atlas
确保用户具有足够的权限