MSTC-DA-IICT / REST-API-Node

Node JS project for Hacktoberfest 2021. Maintained by MSTC.
MIT License
2 stars 20 forks source link

unhandled promise from mongo solved #63

Closed AmasiaNalbandian closed 2 years ago

AmasiaNalbandian commented 2 years ago

This PR deals with the unhandled promise rejection error that keeps appearing in the console when trying to connect to the database.

There are still errors connecting to the database, which will be handled in another PR.

Essentially MongoDB requires to use the then/catch instead of the mongoose.connection.on method.

The error: Code_yT4vJRYpkY

After handling the promise: image