fullstack-typescript-mern-todo icon indicating copy to clipboard operation
fullstack-typescript-mern-todo copied to clipboard

Mongoose ConnectOptions Type Seems To Have REALLY Changed

Open giacomo9999 opened this issue 3 years ago • 0 comments

In app.ts, the lines below need to be removed:

const options = { useNewUrlParser: true, useUnifiedTopology: true } mongoose.set("useFindAndModify", false)

Recent releases of Mongoose seem to set those options automatically. I am new to using TypeScript with Mongoose, but the new ConnectOptions type definition is (apparently) something very different than what it used to be. If the above lines are not removed, TypeScript will yell at you (in its own confusing way) that the ConnectOptions type does not include a "useNewUrlParser" property.

If the above lines are removed from app.ts, everything seems to work fine.

giacomo9999 avatar Sep 14 '21 14:09 giacomo9999