taenyLog
connection error MongoParseError: option usecreateindex is not supported 본문
connection error MongoParseError: option usecreateindex is not supported
taenyLog 2023. 6. 29. 09:00https://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 |