DEV Community

Discussion on: Building a RESTful API with NestJS and MongoDB (Mongoose)

Collapse
 
carlomigueldy profile image
Carlo Miguel Dy

Hey, yea it's good too if you explicitly define the return type of the function. You can pass down a generic type argument to Promise as well so you don't accidentally return a different type of data and that might cause bugs to your code.