title: MongoDB ECONNRESET error
body: <p>I'm trying to setup a basic mongodb connection, but I get an <code>ECONNRESET</code> error. I've researched a bit and found similar questions and answers but haven't found a solution.</p>
  
  <p><strong>Code:</strong></p>
  
  <pre><code>'use strict';
  
  const Hapi = require('hapi');
  const hapiMongo = require('hapi-mongodb');
  
  var server = new Hapi.Server();
  server.connection({
    port: '1111'
  });
  
  server.route({
    method: 'GET',
    path: '/',
    config: {
      cors: true,
      handler: (request, reply) =&gt; {
        var db = request.server.plugins['hapi-mongodb'].db;
        reply('Hello World' + db);
      }
    }
  });
  
  server.register({
    register: hapiMongo,
    options: {
      "url": "mongodb://username:psswd@ds011308.mongolab.com:11308/heroku_jg542kf4",
      "settings": {
        "db": {
          "native_parser": false
        }
      }
    }
  }, (err) =&gt; {
    if (err) {
      console.error(err);
      throw err;
    }
    server.start((err) =&gt; console.log('Served at:', server.info.uri));
  })
  </code></pre>
  
  <p><strong>Console error:</strong> </p>
  
  <blockquote>
    <p>{ [MongoError: server ds011308-a.mongolab.com:11308 received an error
    {"name":"M ongoError","message":"read ECONNRESET"}]   name:
    'MongoError',   message: 'server ds011308-a.mongolab.com:11308
    received an error {"name":"Mong oError","message":"read ECONNRESET"}'
    }</p>
    
    <p>C:\Users\username\Desktop\code\hapi-mongo\node_modules\mongodb\lib\mongo_client.js:4
    54
                  throw err
                  ^  MongoError: server ds011308-a.mongolab.com:11308 received an error {"name":"Mon goError","message":"read ECONNRESET"}
        at null. (C:\Users\username\Desktop\code\hapi-mongo\node_modules\mong
    odb-core\lib\topologies\server.js:297:40)
        at emitTwo (events.js:87:13)
        at emit (events.js:172:7)
        at null. (C:\Users\username\Desktop\code\hapi-mongo\node_modules\mong
    odb-core\lib\connection\pool.js:132:12)
        at g (events.js:260:16)
        at emitTwo (events.js:87:13)
        at emit (events.js:172:7)
        at Socket. (C:\Users\username\Desktop\code\hapi-mongo\node_modules\mo
    ngodb-core\lib\connection\connection.js:132:49)
        at Socket.g (events.js:260:16)
        at emitOne (events.js:77:13)</p>
  </blockquote>
  
  <p>Any pointers on how I can fix this?</p>