title: Getting Mongo Network Error while connecting to mongo atlas uri
body: <p>I am using mongo Atlas uri and getting mongo network error . Sometimes it works but sometimes it throws error.</p>
  <blockquote>
  <p>Error: connect ETIMEDOUT 13.234.241.108:27017</p>
  </blockquote>
  <pre><code>Server started on port 5000
  Error: connect ETIMEDOUT 13.234.241.108:27017
      at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1137:16) {
    name: 'MongoNetworkError'
  }
  something wrong with DB
  </code></pre>
  <p>mongoDb Uri</p>
  <pre><code>mongoose
    .connect(
      `mongodb+srv://pratham:&lt;password&gt;@cluster0.gxwve.mongodb.net/twitter-clone?retryWrites=true&amp;w=majority`,
      {
        useNewUrlParser: true,
        useUnifiedTopology: true,
        useCreateIndex: true,
        useFindAndModify: false,
        keepAlive: true,
      }
    )
    .then(() =&gt; {
      console.log(&quot;DB Connected&quot;);
    })
    .catch((err) =&gt; {
      console.log(err);
      console.log(&quot;something wrong with DB&quot;);
    });
  </code></pre>