CountQueryOptions
Defined in: define/table/types/query.ts:139
Defines the options available for a COUNT query.
Example
Section titled “Example”// Count all active usersconst activeUserCount = await User.count({ where: surql`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?”
optionalgroupBy: (string| keyofTTable)[]
Defined in: define/table/types/query.ts:143
An array of fields to group the results by before counting.
parallel?
Section titled “parallel?”
optionalparallel:boolean
Defined in: define/table/types/query.ts:145
If true, runs the query in parallel with other queries.
timeout?
Section titled “timeout?”
optionaltimeout:string
Defined in: define/table/types/query.ts:147
The timeout for the query, specified in a duration string (e.g. “1m”).
where?
Section titled “where?”
optionalwhere:string
Defined in: define/table/types/query.ts:141
The WHERE clause to filter the records before counting.