diff --git a/sequelize/sequelize-tests.ts b/sequelize/sequelize-tests.ts index 0f274e20a9..4fedb55c5f 100644 --- a/sequelize/sequelize-tests.ts +++ b/sequelize/sequelize-tests.ts @@ -888,6 +888,10 @@ User.findAll( { include : [User], order : [['id', 'ASC NULLS LAST'], [User, 'id' User.findAll( { include : [{ model : User, where : { title : 'DoDat' }, include : [{ model : User }] }] } ); User.findAll( { attributes: ['username', 'data']}); User.findAll( { attributes: {include: ['username', 'data']} }); +User.findAll( { attributes: [['username', 'UNM'], ['email', 'EML']] }); +User.findAll( { attributes: [s.fn('count', Sequelize.col('*'))] }); +User.findAll( { attributes: [[s.fn('count', Sequelize.col('*')), 'count']] }); +User.findAll( { attributes: [[s.fn('count', Sequelize.col('*')), 'count']], group: ['sex'] }); User.findById( 'a string' ); diff --git a/sequelize/sequelize.d.ts b/sequelize/sequelize.d.ts index 8d058efdb2..df87d5a20f 100644 --- a/sequelize/sequelize.d.ts +++ b/sequelize/sequelize.d.ts @@ -3133,7 +3133,7 @@ declare module "sequelize" { * `Sequelize.literal`, `Sequelize.fn` and so on), and the second is the name you want the attribute to * have in the returned instance */ - attributes? : Array | { include?: Array, exclude?: Array }; + attributes?: Array | { include?: Array, exclude?: Array }; /** * If true, only non-deleted records will be returned. If false, both deleted and non-deleted records will @@ -3194,6 +3194,12 @@ declare module "sequelize" { */ having? : WhereOptions; + /** + * Group by. It is not mentioned in sequelize's JSDoc, but mentioned in docs. + * https://github.com/sequelize/sequelize/blob/master/docs/docs/models-usage.md#user-content-manipulating-the-dataset-with-limit-offset-order-and-group + */ + group?: string | string[] | Object; + } /** @@ -6186,4 +6192,4 @@ declare module "sequelize" { export = sequelize; -} +} \ No newline at end of file