Thursday, 18 April 2019

Need NestJS help please. I have a project written with nestjs, where I want to connect to a MongoDB using mongoose, where the connection string is obtained asynchronously.

I'm very new to NestJS. But the idea is that upon startup, the nest project will query something to obtain the mongo connection string. This will of course be done asynchronously.How then do I instantiate the connection to the mongodb? Every example I've seen assumes a static connection string and just passes it into the MongooseModule.forRoot() in the app module decorator.MongooseModule.forRootAsyn() hasn't worked for me either as I'm failing to inject the service which provides the connection string.Any help, tutorial references, suggestions, etc are greatly appreciated.

Submitted April 18, 2019 at 09:08PM by Jaanold

No comments:

Post a Comment