Handling Mongoose connection failure in NestJS

Viewed 48

I am new to NestJS.

I am trying to connect to mongo instance, like this MongooseModule.forRoot('mongodb://localhost:27017/demo')

How can I handle no connection here.

1 Answers

Probably you wrote wrong database URL. You have to follow official documentation: Mongo

Related