UnhandledPromiseRejectionWarning: MongoParseError: option usecreateindex is not supported. I have this error while connection. Can u please tell me about it
Basir Changed status to publish September 15, 2022
From the Mongoose 6.0 docs:
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.
await mongoose.connect('mongodb://localhost:27017/test', {
useNewUrlParser: true, // <-- no longer necessary
useUnifiedTopology: true // <-- no longer necessary
});
Basir Changed status to publish September 15, 2022