mongodb와 mongoose 연동 시 발생한 에러 제거 방법
npm uninstall mongoose ; npm install --save mongoose@5.10.7
// 기존에 설치된 mongoose 삭제 ; @ 뒤의 버전으로 mongoose를 재설치
최신 버전은 https://mongoosejs.com/ 아래의 링크를 확인한다.
아래와 같이 기존에 사용하던 기능이 deprecated 되거나 port 관련 에러가 발생할 경우 mongoose.connect에 option을 부여한다.
mongoose.connect("mongodb://localhost:27017/yelp_camp", { useNewUrlParser: true, useUnifiedTopology: true});
// 27017은 mongodb에서 사용하는 port
(node:1159) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser,
pass option { useNewUrlParser: true } to MongoClient.connect.
(node:1159) DeprecationWarning: current Server Discovery and Monitoring engine is deprecated, and will be removed in a future version. T
o use the new Server Discover and Monitoring engine, pass option { useUnifiedTopology: true } to the MongoClient constructor.
'Full stack development > The Web Developer Bootcamp(2020)' 카테고리의 다른 글
310. YelpCamp: Campground Show Page Part 2 (0) | 2020.09.30 |
---|---|
309. YelpCamp: Campground Show Page Part 1 (0) | 2020.09.30 |
306. Introduction to Mongoose Pt. 2 (0) | 2020.09.27 |
305. Introduction to Mongoose Pt. 1 (0) | 2020.09.27 |
302. Note about the installing MongoDB (0) | 2020.09.27 |