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.

FieldSelect

FieldSelect<TFields> = { [K in keyof TFields]?: true | NestedFieldSelect | TypedExpr<unknown> } & object & object

Defined in: define/table/types/select.ts:104

Type-safe field selection object. Maps field names to selection values (true, nested selection, or typed expression).

*?

optional *: true

TFields extends Record<string, FieldDefinition<unknown>>

The field definitions of the table.

// Select specific fields
{ title: true, content: true }
// Select with nested record
{ title: true, author: { name: true, email: true } }
// Select all + expand record
{ '*': true, author: true }
// With custom computed field
{ title: true, commentCount: typed<number>(surql`count(<-comment)`) }