1. SELECT foo, bar ...

    Attributes can be renamed using a nested array:

    1. Model.findAll({
    2. attributes: ['foo', ['bar', 'baz']]
    1. Model.findAll({
    2. attributes: [[sequelize.fn('COUNT', sequelize.col('hats')), 'no_hats']]
    3. });

      When using aggregation function, you must give it an alias to be able to access it from the model. In the example above you can get the number of hats with .

      1. SELECT id, foo, bar, baz, quz, COUNT(hats) AS no_hats ...

      Similarly, it's also possible to remove a selected few attributes:

      1. Model.findAll({
      2. attributes: { exclude: ['baz'] }