title: I created a MongoDB user with full credentials yet authentication fails when trying to connect to a db using mongoose
body: <p>Im using MongoDB server version:4.0.6 and Mongoose version 5.4.18. I have created the following MongoDB user:</p>
  
  <pre><code>"_id" : "admin.matt",
  "user" : "matt",
  "db" : "admin",
  "roles" : [
          {
                  "role" : "readWrite",
                  "db" : "user-data"
          },
          {
                  "role" : "userAdminAnyDatabase",
                  "db" : "admin"
          },
          {
                  "role" : "readWrite",
                  "db" : "admin"
          },
          {
                  "role" : "dbAdminAnyDatabase",
                  "db" : "admin"
          },
          {
                  "role" : "readWriteAnyDatabase",
                  "db" : "admin"
          }
  ],
  "mechanisms" : [
          "SCRAM-SHA-1",
          "SCRAM-SHA-256"
  ]
  
  </code></pre>
  
  <p>I am trying to connect using the following mongoose command: </p>
  
  <pre><code>mongoose.connect('mongodb://matt:passwordexample!@localhost:27017/user-data', {useNewUrlParser: true});
  </code></pre>
  
  <p>It replies with <strong>MongoError: Authentication failed.</strong></p>
  
  <p>I have tried multiple connection formats and nothing as worked.  Is my user credentials not set up correctly?  Thank you.</p>
  
  <p>and this is my package.json.  Do I need MongoDB here if I have mongoose?</p>
  
  <pre><code>"dependencies": {
      "body-parser": "^1.18.3",
      "express": "^4.16.4",
      "express-handlebars": "^3.0.2",
      "express-session": "^1.15.6",
      "express-validator": "^5.3.1",
      "forever": "^0.15.3",
      "mongoose": "^5.4.18",
      "nodemon": "^1.18.10",
      "path": "^0.12.7"
    },
  </code></pre>