免责声明:类似的主题没有为我的问题提供有效的解决方案!
mongodb://127.0.0.1:27017/directConnection=true&serverSelectionTimeoutMS=2000
)http://localhost:3000/我正在听的( app.listen(3000);)但是,我仍然收到以下错误:
const timeoutError = new error_1.MongoServerSelectionError(`Server selection timed out after ${serverSelectionTimeoutMS} ms`, this.description); ^
MongoServerSelectionError: connect ECONNREFUSED ::1:27017
at Timeout._onTimeout (\node_modules\mongodb\lib\sdam\topology.js:330:38)
at listOnTimeout (node:internal/timers:557:17)
at processTimers (node:internal/timers:500:7) {
reason: TopologyDescription {
type: 'Unknown',
servers: Map(1) {
'localhost:27017' => ServerDescription {
_hostAddress: HostAddress { …Run Code Online (Sandbox Code Playgroud)