title: MongoError: server instance in invalid state undefined after upgrading mongoose module
body: <p>I updated my <code>mongoose</code> npm module from  <code>"mongoose": "~3.8.8"</code> to <code>"mongoose": "^4.1.12"</code>. I am using simple MEAN project as is <a href="http://meanjs.org/docs/0.3.x/" rel="nofollow">documented here</a> and got following error after upgrading <code>mongoose</code> node module :</p>
  
  <pre><code>MongoError: server instance in invalid state undefined
      at Function.MongoError.create (SampleProject\node_modules\mongodb-core\lib\error.js:29:11)
      at Server.connect (SampleProject\node_modules\mongodb-core\lib\topologies\server.js:341:22)
      at Server.connect (SampleProject\node_modules\mongoose\node_modules\mongodb\lib\server.js:357:17)
      at open (SampleProject\node_modules\mongoose\node_modules\mongodb\lib\db.js:222:19)
      at Db.open (SampleProject\node_modules\mongoose\node_modules\mongodb\lib\db.js:245:44)
      at MongoStore._open_database (SampleProject\node_modules\connect-mongo\lib\connect-mongo.js:182:15)
      at MongoStore._get_collection (SampleProject\node_modules\connect-mongo\lib\connect-mongo.js:177:14)
      at MongoStore.get (SampleProject\node_modules\connect-mongo\lib\connect-mongo.js:222:10)
      at Layer.session [as handle] (SampleProject\node_modules\express-session\index.js:204:11)
      at trim_prefix (SampleProject\node_modules\express\lib\router\index.js:230:15)
      at SampleProject\node_modules\express\lib\router\index.js:198:9
      at Function.proto.process_params (SampleProject\node_modules\express\lib\router\index.js:253:12)
  </code></pre>
  
  <p>Any help ?</p>