Я пытаюсь подключиться к атласу mongodb через драйвер mon goose, и он продолжает выдавать MongooseServerSelectionError
, и я проверил свое имя пользователя и пароль для пользователя базы данных, и это правильно .
Вот мой код:
server running on port 3000
we are connected: { MongooseServerSelectionError: connection timed out
at new MongooseServerSelectionError (/home/ateyib/UCSD-classes/CSE 135/hw3/node_modules/mongoose/lib/error/serverSelection.js:22:11)
at NativeConnection.Connection.openUri (/home/ateyib/UCSD-classes/CSE 135/hw3/node_modules/mongoose/lib/connection.js:808:32)
at Mongoose.connect (/home/ateyib/UCSD-classes/CSE 135/hw3/node_modules/mongoose/lib/index.js:333:15)
at Object.<anonymous> (/home/ateyib/UCSD-classes/CSE 135/hw3/server.js:17:4)
at Module._compile (internal/modules/cjs/loader.js:738:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:749:10)
at Module.load (internal/modules/cjs/loader.js:630:32)
at tryModuleLoad (internal/modules/cjs/loader.js:570:12)
at Function.Module._load (internal/modules/cjs/loader.js:562:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:801:12)
at internal/main/run_main_module.js:21:11
message: 'connection timed out',
name: 'MongooseServerSelectionError',
reason:
TopologyDescription {
type: 'ReplicaSetNoPrimary',
setName: 'Cluster0-shard-0',
maxSetVersion: null,
maxElectionId: null,
servers:
Map {
'cluster0-shard-00-00-ebets.mongodb.net:27017' => [ServerDescription],
'cluster0-shard-00-01-ebets.mongodb.net:27017' => [ServerDescription],
'cluster0-shard-00-02-ebets.mongodb.net:27017' => [ServerDescription] },
stale: false,
compatible: true,
compatibilityError: null,
logicalSessionTimeoutMinutes: 30,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
commonWireVersion: 8 },
[Symbol(mongoErrorContextSymbol)]: {} }