MongooseError: Model.find() no longer accepts a callback

The use of callback functions has been deprecated in the latest version of Mongoose.

we need to use either Promises or async/await syntax.

Particularly if Model.find throws an error then we can replace it as follows.


Discover more from Learners Store

Subscribe to get the latest posts sent to your email.

Leave a comment