title: AssertionError [ERR_ASSERTION]: handler (func) is required in mongodb
body: <p>I am using mongooose to connect mongodb but i am getting following error</p>
  
  <pre><code>/Users/uchitkumar/api/node_modules/mongodb/lib/mongo_client.js:804
            throw err;
            ^
  
  AssertionError [ERR_ASSERTION]: handler (func) is required
      at new AssertionError (internal/errors.js:315:11)
      at _toss (/Users/uchitkumar/api/node_modules/assert-plus/assert.js:22:11)
      at Function.out.(anonymous function) [as func] (/Users/uchitkumar/api/node_modules/assert-plus/assert.js:122:17)
      at process (/Users/uchitkumar/api/node_modules/restify/lib/server.js:1352:20)
      at argumentsToChain (/Users/uchitkumar/api/node_modules/restify/lib/server.js:1361:12)
      at Server.serverMethod [as put] (/Users/uchitkumar/api/node_modules/restify/lib/server.js:1475:21)
  </code></pre>
  
  <p>my code for connection is as follow</p>
  
  <pre><code>server.listen(config.port, function() {
  
      mongoose.connection.on('error', function(err) {
          console.log('Mongoose default connection error: ' + err)
          process.exit(1)
      })
  
      mongoose.connection.on('open', function(err) {
  
          if (err) {
              console.log('Mongoose default connection error: ' + err)
              process.exit(1)
          }
  
          console.log(
              '%s v%s ready to accept connections on port %s in %s environment.',
              server.name,
              config.version,
              config.port,
              config.env
          )
  
          require('./routes')
  
      })
  
      global.db = mongoose.connect(config.db.uri)
  
  })
  </code></pre>
  
  <p>routes code </p>
  
  <pre><code>server.get('/', function indexHTML(req, res, next) {
      fs.readFile(__dirname + '/../index.html', function (err, data) {
          if (err) {
              next(err);
              return;
          }
  
          res.setHeader('Content-Type', 'text/html');
          res.writeHead(200);
          res.end(data);
          next();
      });
  });
  </code></pre>
  
  <p>This was fine ... I changed something and now it stopped working with this error. The error is that it is not able to assert some function... in mongodb client. it needed a function. Is it asking to add some handler function? where to add that
  Thank in advance </p>