title: Error Message: MongoError: bad auth Authentication failed through URI string
body: <p>I'm trying to connect to my mongoDB server via the connection string given to me by mongo:</p>
  <pre class="lang-js prettyprint-override"><code>&quot;mongodb+srv://david:password@cluster0-re3gq.mongodb.net/test?retryWrites=true&quot;
  </code></pre>
  <p>In my code I am calling the connection through mongoose like this (obviously putting in my password):</p>
  <pre><code>const mongoose = require('mongoose');
  const db = 'mongodb+srv://david:&lt;password&gt;@cluster0-re3gq.mongodb.net/test?retryWrites=true'
  mongoose
      .connect(db, { 
          useNewUrlParser: true,
          useCreateIndex: true
        })
      .then(() =&gt; console.log('MongoDB connected...'))
      .catch(err =&gt; console.log(err));
  </code></pre>
  <p>When I run the code I am getting the following error</p>
  <blockquote>
  <p>&quot;MongoError: bad auth Authentication failed.&quot;</p>
  </blockquote>
  <p>Any ideas of what that could mean?</p>