簡體   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