Skip to content
🚀 This documentation is for unreal-orm 1.0.0 alpha which requires SurrealDB 2.0 alpha SDK. For the stable version, see npm.

CountQueryOptions

Defined in: define/table/types/query.ts:139

Defines the options available for a COUNT query.

// Count all active users
const activeUserCount = await User.count({
where: surql`isActive = true`
});

TTable

The data shape of the table being queried.

optional groupBy: (string | keyof TTable)[]

Defined in: define/table/types/query.ts:143

An array of fields to group the results by before counting.


optional parallel: boolean

Defined in: define/table/types/query.ts:145

If true, runs the query in parallel with other queries.


optional timeout: string

Defined in: define/table/types/query.ts:147

The timeout for the query, specified in a duration string (e.g. “1m”).


optional where: string

Defined in: define/table/types/query.ts:141

The WHERE clause to filter the records before counting.