Relative Content

Tag Archive for mongodbmongooseconnection

Getting an error, while trying to connect my db

PS C:librarybackend> node server.js
Server is up and running on port 5000
Connection error: 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: https://www.mongodb.com/docs/atlas/security-whitelist/
at _handleConnectionErrors (C:librarynode_modulesmongooselibconnection.js:896:11)
at NativeConnection.openUri (C:librarynode_modulesmongooselibconnection.js:847:11)
at async connectDB (C:librarybackendserver.js:7:9) {
reason: TopologyDescription {
type: ‘ReplicaSetNoPrimary’,
servers: Map(3) {
‘ac-ktecdkm-shard-00-02.uds5psd.mongodb.net:27017’ => [ServerDescription],
‘ac-ktecdkm-shard-00-01.uds5psd.mongodb.net:27017’ => [ServerDescription],
‘ac-ktecdkm-shard-00-00.uds5psd.mongodb.net:27017’ => [ServerDescription]
},
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: ‘atlas-n6pjod-shard-0’,
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined
}

Getting an error, while trying to connect my db

PS C:librarybackend> node server.js
Server is up and running on port 5000
Connection error: 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: https://www.mongodb.com/docs/atlas/security-whitelist/
at _handleConnectionErrors (C:librarynode_modulesmongooselibconnection.js:896:11)
at NativeConnection.openUri (C:librarynode_modulesmongooselibconnection.js:847:11)
at async connectDB (C:librarybackendserver.js:7:9) {
reason: TopologyDescription {
type: ‘ReplicaSetNoPrimary’,
servers: Map(3) {
‘ac-ktecdkm-shard-00-02.uds5psd.mongodb.net:27017’ => [ServerDescription],
‘ac-ktecdkm-shard-00-01.uds5psd.mongodb.net:27017’ => [ServerDescription],
‘ac-ktecdkm-shard-00-00.uds5psd.mongodb.net:27017’ => [ServerDescription]
},
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: ‘atlas-n6pjod-shard-0’,
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined
}