라벨이 MongooseServerSelectionError인 게시물 표시

[MongoDB] Mongoose 연결 에러 ( MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. )

Mongoose 로 MongoDB 연결시 에러  MongoDB를 Mongoose를 사용하여 연결해주었다. 원래 잘 작동했었는데 갑자기 에러 메세지를 뿜었다. Example app listening at http://localhost:5000 [0] MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster. One common reason is that you're trying to access the database from an IP that isn't whitelisted. 찾아보니 mongoDB 연결시에 맨처음에 아이피 주소를 설정해줬었는데  집에서만 맨날 공부하다가 오랜만에 카페에 나왔더니 아이피 주소가 변경되어서 접속이 안된것이었다. mongoDB 사이트에 접속해서 해당 cluster에서 Network Access로 들어가서    ADD IP ADDRESS ADD IP ADDRESS 버튼을 클릭하여 맥의 경우  시스템 환경설정 -> 네트워크 에 접속하여 현재 연결된 Wi-Fi 의 IP 주소를 복사여 추가해준다.