Connect with db

 const timeoutError = new error_1.MongoServerSelectionError(`Server selection timed out after ${options.serverSelectionTimeoutMS} ms`, this.description);
                             ^

MongoServerSelectionError: connect ECONNREFUSED ::1:27017
at EventTarget. (C:\Users\Abzal\OneDrive - Lovely Professional University\Desktop\Node\node_modules\mongodb\lib\sdam\topology.js:276:34)
at [nodejs.internal.kHybridDispatch] (node:internal/event_target:757:20)
at EventTarget.dispatchEvent (node:internal/event_target:692:26)
at abortSignal (node:internal/abort_controller:369:10)
at TimeoutController.abort (node:internal/abort_controller:403:5)
at Timeout. (C:\Users\Abzal\OneDrive - Lovely Professional University\Desktop\Node\node_modules\mongodb\lib\utils.js:1010:92)
at listOnTimeout (node:internal/timers:569:17)
at process.processTimers (node:internal/timers:512:7) {
reason: TopologyDescription {
type: ‘Unknown’,
servers: Map(1) {
‘localhost:27017’ => ServerDescription {
address: ‘localhost:27017’,
type: ‘Unknown’,
hosts: ,
passives: ,
arbiters: ,
tags: {},
minWireVersion: 0,
maxWireVersion: 0,
roundTripTime: -1,
lastUpdateTime: 586271229,
lastWriteDate: 0,
error: MongoNetworkError: connect ECONNREFUSED ::1:27017
at connectionFailureError (C:\Users\Abzal\OneDrive - Lovely Professional University\Desktop\Node\node_modules\mongodb\lib\cmap\connect.js:379:20)
at Socket. (C:\Users\Abzal\OneDrive - Lovely Professional University\Desktop\Node\node_modules\mongodb\lib\cmap\connect.js:285:22)
at Object.onceWrapper (node:events:632:26)
at Socket.emit (node:events:517:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
[Symbol(errorLabels)]: Set(1) { ‘ResetPool’ },
[cause]: Error: connect ECONNREFUSED ::1:27017
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
errno: -4078,
code: ‘ECONNREFUSED’,
syscall: ‘connect’,
address: ‘::1’,
port: 27017
}
},
topologyVersion: null,
setName: null,
setVersion: null,
electionId: null,
logicalSessionTimeoutMinutes: null,
primary: null,
me: null,
‘$clusterTime’: null
}
},
stale: false,
compatible: true,
heartbeatFrequencyMS: 10000,
localThresholdMS: 15,
setName: null,
maxElectionId: null,
maxSetVersion: null,
commonWireVersion: 0,
logicalSessionTimeoutMinutes: null
},
code: undefined,
[Symbol(errorLabels)]: Set(0) {},
[cause]: MongoNetworkError: connect ECONNREFUSED ::1:27017
at connectionFailureError (C:\Users\Abzal\OneDrive - Lovely Professional University\Desktop\Node\node_modules\mongodb\lib\cmap\connect.js:379:20)
at Socket. (C:\Users\Abzal\OneDrive - Lovely Professional University\Desktop\Node\node_modules\mongodb\lib\cmap\connect.js:285:22)
at Object.onceWrapper (node:events:632:26)
at Socket.emit (node:events:517:28)
at emitErrorNT (node:internal/streams/destroy:151:8)
at emitErrorCloseNT (node:internal/streams/destroy:116:3)
at process.processTicksAndRejections (node:internal/process/task_queues:82:21) {
[Symbol(errorLabels)]: Set(1) { ‘ResetPool’ },
[cause]: Error: connect ECONNREFUSED ::1:27017
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16) {
errno: -4078,
code: ‘ECONNREFUSED’,
syscall: ‘connect’,
address: ‘::1’,
port: 27017
}
}
}

Looks like you’re trying to connect to a local mongo instance (localhost). Can you connect to the instance with Compass to verify that the server is running correctly?