title: MongoError: cannot establish topology capabilities as driver is still in process of connecting at Server.capabilities
body: <p>I'm trying to connect to mongoDB via mongoose.connect and I continue to get the error:</p>
  
  <pre><code>/Users/Documents/Business/01000100/node_modules/connect-mongo/lib/connect-mongo.js:133
            throw err;
                  ^
  MongoError: cannot establish topology capabilities as driver is still in process of connecting
      at Server.capabilities
  </code></pre>
  
  <p>auth_server.js:</p>
  
  <pre><code>    var express         = require('express')
  var body_parser     = require('body-parser')
  var cookie_parser   = require('cookie-parser')
  var express_session = require('express-session')
  var mongo_store     = require('connect-mongo')({session:express_session})
  var mongoose        = require('mongoose')
  var morgan          = require('morgan')
  var port            = 8080
  
  //MODELS
  require('./models/user_model.js')
  
  //CONFIG
  mongoose.connect('mongodb://localhost/db')
  
  var app = express()
  
  //VIEW ENGINE
  app.engine('.html', require('ejs').__express)
  app.set('views', __dirname + '/views')
  app.set('view engine', 'html')
  
  //MIDDLEWARE
  app.use(morgan('dev'))//logging requests
  app.use(body_parser.urlencoded({extended: true}));
  app.use(cookie_parser())
  app.use(express_session({
      secret: '2!H$,Br2&amp;1XW74zpd897ytf lbph=-0987654edfvbn5Q4AQ0]k7XX2Plh915ZV2)0)2DvHK}4KA"^6J!TY;x4z04',
      cookie: {maxAge: 60 * 60 * 1000},
      store: new mongo_store({
          db: mongoose.connection.db,
          collection: 'sessions'
      }),
      resave: false,
      saveUninitialized: false
  }))
  
  //ROUTES
  require('./routes')(app)
  
  //START
  app.listen(port)
  console.log('Santa is listening on ' + port)
  </code></pre>
  
  <p>Does anyone know what is causing this problem or how to fix it? I've spent a bunch of hours on it researching and I still cannot seem to pinpoint a solution. Thank you very much in advance.</p>