title: tried to connect mongodb with my app getting an error
body: <p>The error is <strong>&quot;MongooseError: The <code>uri</code> parameter to <code>openUri()</code> must be a string, got &quot;undefined&quot;. Make sure the first parameter to <code>mongoose.connect()</code> or <code>mongoose.createConnection()</code> is a string.&quot;</strong>
  I'm attaching ss of the file and the error <a href="https://i.stack.imgur.com/mIhNA.png" rel="nofollow noreferrer">error image</a></p>
  <p>the code in db.js(suubed in config folder) is</p>
  <pre><code>const mongoose = require('mongoose')
  
  const connectDB = async () =&gt; {
      try {
          const conn = await mongoose.connect(process.env.MONGO_URI, {
              useNewUrlParser: true,
              useUnifiedTopology: true,
              useFindAndModify: false
          })
  
          console.log(`${conn.connection.host}`)
      } catch (err) {
          console.log(err)
      }
  }
  
  module.exports = connectDB
  </code></pre>