반응형
Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Archives
Today
Total
관리 메뉴

taenyLog

connection error MongoParseError: option usecreateindex is not supported 본문

Web

connection error MongoParseError: option usecreateindex is not supported

taenyLog 2023. 6. 29. 09:00
반응형

https://www.mongodb.com/community/forums/t/option-usecreateindex-is-not-supported/123048

 

Option usecreateindex is not supported

I am trying to connect mongoDB to my web app but it is saying that usercreateindex is not supported please help me with this This is the code from my index.js file const express = require('express'); const app = express(); const mongoose = require('mongoos

www.mongodb.com

 

 

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 .

 

즉 더이상 몽구스6부터는 useNewUrlParser, useUnifiedTopology, 및 useCreateIndex는 true, useFindAndModify는 false.로 동작하기에 코드를 써줄 필요가 없다는 것이다 

mongoose.connect("mongodb://localhost:27017/h-pl", {
  useNewUrlParser: true,
  useCreateIndex: true,
  useUnifiedTopology: true,
});

 

반응형

'Web' 카테고리의 다른 글

[JavaScript] Variables  (0) 2023.09.11
[JavaScript] NaN  (0) 2023.09.11
async await 쓰는 이유  (0) 2023.06.29
Mongoose | findByIdAndDelete()  (0) 2023.06.29
Mongoose | findByIdAndUpdate()  (0) 2023.06.29