• 카테고리

    질문 & 답변
  • 세부 분야

    백엔드

  • 해결 여부

    미해결

mongodb connect

22.11.01 09:20 작성 조회수 185

0

    await mongoose.connect(MONGO_URI, {useNewUrlParser : true , useUnifiedTopology:true , useCreateIndex:true});

 

 useCreateIndex:true}

이부분을 추가시 mongodb 6.0이상 버전에서

MongoParseError: option usecreateindex is not supported

위와 같은 에러가 발생합니다.

답변 1

답변을 작성해보세요.

0

useCreateIndex: true 부분이 deprecate 되어서 코드에서 제외시켜주시면 됩니다

오서경님의 프로필

오서경

2022.11.04

해당 코드를 빼면 unique index가 안되는거 같습니다!