CountQueryOptions
Defined in: define/table/types/query.ts:218
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”DEBUG?
Section titled “DEBUG?”
optionalDEBUG:boolean
Defined in: define/table/types/query.ts:231
If true, outputs the generated query and bindings for debugging.
groupBy?
Section titled “groupBy?”
optionalgroupBy: (string| keyofTTable)[]
Defined in: define/table/types/query.ts:222
An array of fields to group the results by before counting.
parallel?
Section titled “parallel?”
optionalparallel:boolean
Defined in: define/table/types/query.ts:227
timeout?
Section titled “timeout?”
optionaltimeout:string
Defined in: define/table/types/query.ts:229
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:220
The WHERE clause to filter the records before counting.