반응형

Mongoose 에러 2

[Nodejs - Mongoose] MongooseServerSelectionError: Could not connect to any servers in your MongoDB Atlas cluster.

[배경] MongoDB를 사용하기위해 MongoDB 공식 웹페이지의 Cluster를 사용하고자 했다. (https://www.mongodb.com/) 이번에도 마찬가지로 위의 예쁜코드를 사용했다. *connect에 나오는 저 URL이 MongoDB Cluster를 생성하여 얻은 Connection String이다. 그러나..이번에도 결과는 참혹했다. 다음과 같은 오류가 나와버린 것..! 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 w..

재학습/오류 2021.10.06

[Nodejs - Mongoose] MongoParseError: options usecreateindex, usefindandmodify are not supported

[배경] NodeJS에서 Express프레임워크를 설치하여 적용하고, MongoDB사용을위해 MongoDB 사용 툴인 Mongoose를 설치하였다. 위처럼 코드를 예쁘게 작성해준뒤 npm run start로 시작을 해주었지만 결과는 참혹했다. MongoParseError: options usecreateindex, usefindandmodify are not supported가 발생해버린 것! 예시를 보고 이쁘게 따라쳐줬는데 뭐가 문제였을까.. [결과] 몽구스 버전이 6.0이상이라 발생하는 이유였다. 6.0이상이라면 {useNewUrlParser:true, uiseUnifiedTopology:true, useCreateIndex:true, useFindAndModifiy:false} 이 내용이 기본값이된..

재학습/오류 2021.10.06
반응형