Unable to connect to MongoDB Atlas using Mongoose with connection string [closed]

可紊 提交于 2021-02-10 20:18:51

问题


These are the errors I received:

(node:11692) UnhandledPromiseRejectionWarning: MongoNetworkError: connection 5 to cluster0-shard-00-01-wwvto.mongodb.net:27017 closed
    at TLSSocket. (C:\Node Example\node-rest-shop\node_modules\mongodb-core\lib\connection\connection.js:276:9)
    at Object.onceWrapper (events.js:273:13)
    at TLSSocket.emit (events.js:187:15)
    at _handle.close (net.js:606:12)
    at TCP.done (_tls_wrap.js:386:7)
(node:11692) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error
originated either by throwing inside of an async function without a catch block, or by
rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:11692) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In
the future, promise rejections that are not handled will terminate the Node.js process
with a non-zero exit code.

回答1:


Yes you can always add your local IP Address by going to:

Security - > IP Whitelist and then add a new IP. There you can click "ADD CURRENT IP ADDRESS" along with any comment:



来源:https://stackoverflow.com/questions/54141233/unable-to-connect-to-mongodb-atlas-using-mongoose-with-connection-string

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!