繁体   English   中英

使用Mongoose时出现MongoDb连接错误

[英]MongoDb Connection Error when using Mongoose

我以前在家中通过wifi连接到Atlas时没有问题。 但我在星巴克遇到问题。 我现在已切换到Google Fiber,但出现此错误。

    at Pool.<anonymous> (/Users/j/Desktop/projects/templateApp/node_modules/mongodb-core/lib/topologies/server.js:431:11)
    at Pool.emit (events.js:182:13)
    at connect (/Users/j/Desktop/projects/templateApp/node_modules/mongodb-core/lib/connection/pool.js:557:14)
    at callback (/Users/j/Desktop/projects/templateApp/node_modules/mongodb-core/lib/connection/connect.js:109:5)
    at runCommand (/Users/j/Desktop/projects/templateApp/node_modules/mongodb-core/lib/connection/connect.js:129:7)
    at Connection.errorHandler (/Users/j/Desktop/projects/templateApp/node_modules/mongodb-core/lib/connection/connect.js:321:5)
    at Object.onceWrapper (events.js:273:13)
    at Connection.emit (events.js:182:13)
    at TLSSocket.<anonymous> (/Users/j/Desktop/projects/templateApp/node_modules/mongodb-core/lib/connection/connection.js:350:12)
    at Object.onceWrapper (events.js:273:13)
    at TLSSocket.emit (events.js:182:13)
    at _handle.close (net.js:596:12)
    at TCP.done [as _onclose] (_tls_wrap.js:383:7)
  name: 'MongoNetworkError',
  errorLabels: [ 'TransientTransactionError' ],```

I have checked my strings and they are correct. 

My connection code is: 

```mongoose.connect(process.env.dataBaseConnection, {
  dbName: process.env.dataBaseName,
  useFindAndModify: false,
  useNewUrlParser: true
});```

问题是我需要将新的IP地址列入白名单。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM