Skip to content

postgrelize / FindAndCountOptions

Type Alias: FindAndCountOptions<T> ​

FindAndCountOptions<T> = FindOptions<T> & Readonly<{ col?: string; distinct?: boolean; }>

Defined in: src/model/find-options.ts:93

Options of findAndCountAll (Sequelize v6 FindAndCountOptions): the finder options plus the count options distinct and col. The count query reuses where, include, paranoid, distinct, col, group, replacements, transaction and logging. With group, count is an array of GroupedCountResultItem like in v6.

Type Parameters ​

T ​

T = Values

See ​

Model.findAndCountAll

Example ​

ts
const options: FindAndCountOptions<User> = { where: { active: true }, limit: 10, offset: 20 };
const { count, rows } = await User.findAndCountAll(options);

Released under the MIT License.