seppevs/migrate-mongo

Import user/password/host or complete MongoDB connection URI from environment.

voronin-de opened this issue · 1 comments

Hello,

thank you for such an awesome library!

I am looking for a way to import either user, password and host or a complete connection string from an environment file. We have various environment files (in TypeScript). They contain a complete MongoDB connection string, which we use within the application.

However: I am not sure how to import it into migrate-mongo-config.js. Should I use tsc on the environment..ts files and import the resulting environment..js file and thus be able to access that connection string? Or are there other ways to do this?

I figured we could use process.env as well as expressions such as url: process.env.url !== undefined ? process.env.url : .... So it's probably good enough and I guess this can be closed.