#2 connection error: MongoParseError: option usecreateindex is not supported 해결방법

Dana·2022년 5월 13일
0

Today I Fixed

목록 보기
2/3
post-thumbnail
mongoose.connect('mongodb://localhost:27017/go-camp', {
  useNewUrlParser: true,
  useCreateIndex: true,
  useUnifiedTopology: true
});

connection error: MongoParseError: option usecreateindex is not supported
에러가 발생했다.

몽구스 공식문서에는
No More Deprecation Warning Options
useNewUrlParser, useUnifiedTopology, useFindAndModify, and useCreateIndex are no longer supported options. Mongoose 6 always behaves as if useNewUrlParser, useUnifiedTopology, and useCreateIndex are true, and useFindAndModify is false. Please remove these options from your code.

버전6부터 해당 옵션을 사용하지 않아도 된단다.

그러므로 그냥 지워주면 된다!

profile
웹개발

0개의 댓글