Command Palette

Search for a command to run...

Filtering & Sorting

These options work the same in the server client and the hooks.

Filter structure

example.ts
1 2 3 4 5 6 7 8 9 10 filter: { query: [{ condition: { field: 'name', operator: 'equal', value: 'Acme Corp', }, }], sortby: [{ field: 'created_at', order: 'desc' }], }

Operators

String

OperatorDescriptionExample value
equalExact match"value"
notEqualNot equal"value"
likePattern match (case-sensitive)"%search%"
ilikePattern match (case-insensitive)"%search%"
notLikeNot pattern match"%exclude%"
notiLikeNot pattern match (case-insensitive)"%exclude%"
startsWithStarts with"prefix"
endsWithEnds with"suffix"

Number & date

OperatorDescription
equalEqual to
notEqualNot equal to
greaterThanGreater than
lessThanLess than
greaterThanOrEqualGreater than or equal
lessThanOrEqualLess than or equal

Null & empty

These operators need no value.

OperatorDescription
isNullField is null
isNotNullField is not null
isEmptyEmpty string
isNotEmptyNot empty

Boolean

OperatorDescription
isTrueField is true
isFalseField is false

List

Use values instead of value:

example.ts
1 2 3 4 5 condition: { field: 'status', operator: 'in', values: ['paid', 'pending'], }
OperatorDescription
inValue in list
notInValue not in list

AND / OR

All conditions must match:

example.ts
1 2 3 4 5 6 7 8 filter: { query: [{ and: [ { condition: { field: 'amount_net', operator: 'greaterThan', value: '1000' } }, { condition: { field: 'status', operator: 'equal', value: 'paid' } }, ], }], }

Any condition can match:

example.ts
1 2 3 4 5 6 7 8 filter: { query: [{ or: [ { condition: { field: 'name', operator: 'ilike', value: '%acme%' } }, { condition: { field: 'name', operator: 'ilike', value: '%corp%' } }, ], }], }

Sorting

Multiple sort fields apply in order, primary first.

example.ts
1 2 3 4 5 6 filter: { sortby: [ { field: 'created_at', order: 'desc' }, { field: 'name', order: 'asc' }, ], }

Pagination

example.ts
1 2 3 4 pagination: { page: 1, // 1-indexed per_page: 20, }

Every list response includes:

FieldTypeDescription
totalnumberTotal number of matching entities
current_pagenumberCurrent page number
per_pagenumberItems per page
last_pagenumberLast available page number
has_more_pagesbooleanWhether more pages exist