我无法连接到MongoDb数据库。我检查了几次,我的IP地址在网络访问中正确列出。而且我有以下消息:
message:
'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: https://docs.atlas.mongodb.com/security-whitelist/',
reason:
TopologyDescription {
type: 'ReplicaSetNoPrimary',
setName: null,
maxSetVersion: null,
maxElectionId: null,
servers:
Map {
'cluster0-shard-00-01-216w6.mongodb.net:27017' => [ServerDescription],
'cluster0-shard-00-02-216w6.mongodb.net:27017' => [ServerDescription],
'cluster0-shard-00-00-216w6.mongodb.net:27017' => [ServerDescription] },
stale: false,
compatible: true,
compatibilityError: null,
logicalSessionTimeoutMinutes: null,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
commonWireVersion: null } }
^C
答案 0 :(得分:0)
我遇到了同样的问题,并通过以下方式解决了该问题:
转到“网络访问”。
在注册的IP地址上,执行“编辑”操作。
如果您的IP地址已更改,您将看到一个允许访问当前IP地址的选项,请单击该选项以更新IP。