DEV Community

Discussion on: Open Multiple MongoDB connection in Express.js App

 
piotrmonsiorski profile image
Piotr Monsiorski

It's quite old question, but this may help someone in the future: check if your process.env variables aren't undefined. To fix this, you can move dotenv.config(); to connections.js file and use in before makeNewConnection(...) function.