code: function getMongoConnection(uri, mongodbConnection, cb) {
    logger.debug("getting mongodb connection");
    var mongoConn;
    if (mongodbConnection && typeof mongodbConnection.db === 'function') {
      process.nextTick(function() {
        logger.debug("creating the mongodb connection using the existing connection", {uri: uri});
        var dbName = getDbName(uri);
        mongoConn = mongodbConnection.db(dbName);
        return cb(undefined, mongoConn);
      });
    } else {
      logger.warn("creating a new mongodb connection", {uri: uri});
      return MongoClient.connect(uri, logger.ensureRequestId ? logger.ensureRequestId(cb) : cb);
    }
  }
docs: Get a new mongodb connection instance. Will reuse an existing mongodb connection if it's passed in (this connection should be authenticated already and have access to the target db. E.g. admin user).
  Otherwise a new mongodb connection (connection pool) will be created.
  @param {string} url the uri of the mongodb
  @param {object} mongodbConnection an existing mongodb connection. If exists, it will be resued for the mongodb connection
  @param {function} cb the callback function