code: function setupModels(connection, models) {
    Object.keys(models).forEach(key => {
      const schema = models[key];
      connection.model(key, schema);
    });
  }
docs: mongoose.Promise = Promise /** * Close a given connection to the database. * @param {Connection} connection - connection to close  async function disconnect(connection) { try { await connection.close() } catch (error) { throw error } } /** * Create a connection to a database at URL. * @param {String} url - the url of the database * @returns {Connection} An open mongoose connection.  async function connect(url) { const connection = mongoose.createConnection() try { await connection.openUri(url) return connection } catch (error) { throw error } }