I have a backend with NestJS, it is configured with mongoose. The app.module.ts :
@Module({
imports: [
MongooseModule.forRoot('mongodb://admin:root@localhost:27017/'),
CatsModule
],
controllers: [],
providers: [],
})
If I let the URI like this it works correctly but creates a 'tests' database. I want a custom database, so when I try to set the URI to mongodb://admin:root@localhost:27017/my-custom-db it cant connect...
I've tried to create my-custom-db manually, but it still fails
The error :
[Nest] 14480 - 26/06/2022, 12:28:27 ERROR [MongooseModule] Unable to connect to the database. Retrying (1)...