CountQueryOptions
Defined in: define/table/types/query.ts:78
Defines the options available for a COUNT
query.
Example
Section titled “Example”// Count all active usersconst activeUserCount = await User.count({ where: 'isActive = true'});
Type Parameters
Section titled “Type Parameters”TTable
Section titled “TTable”TTable
The data shape of the table being queried.
Properties
Section titled “Properties”groupBy?
Section titled “groupBy?”
optional
groupBy: (string
| keyofTTable
)[]
Defined in: define/table/types/query.ts:82
An array of fields to group the results by before counting.
parallel?
Section titled “parallel?”
optional
parallel:boolean
Defined in: define/table/types/query.ts:84
If true, runs the query in parallel with other queries.
timeout?
Section titled “timeout?”
optional
timeout:string
Defined in: define/table/types/query.ts:86
The timeout for the query, specified in a duration string (e.g. “1m”).
where?
Section titled “where?”
optional
where:string
Defined in: define/table/types/query.ts:80
The WHERE
clause to filter the records before counting.