fullstack-typescript-mern-todo
fullstack-typescript-mern-todo copied to clipboard
Mongoose ConnectOptions Type Seems To Have REALLY Changed
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.