BeechCMS / @beechcms/client / FluentQuery
Interface: FluentQuery<TRow>
Type Parameters
TRow
TRow
Methods
first()
first(
options?):Promise<BeechResult<Single<TRow>>>
Parameters
options?
Returns
Promise<BeechResult<Single<TRow>>>
include()
include(
relations):this
Parameters
relations
string[]
Returns
this
lang()
lang(
code):this
Requests one language: localized fields come back as plain values in that language, and filters and sort compare in it. An unregistered code falls back to the project default; a malformed one is a 400.
Parameters
code
string
Returns
this
limit()
limit(
count):this
Page size. The serializer caps it at the Public API maximum of 100.
Parameters
count
number
Returns
this
list()
list(
options?):Promise<BeechResult<Listable<TRow>>>
Parameters
options?
Returns
Promise<BeechResult<Listable<TRow>>>
logic()
logic(
operator):this
Combines every where()/whereRelation() condition with AND (default) or OR.
Parameters
operator
"AND" | "OR"
Returns
this
orderBy()
orderBy(
field,direction?):this
Sorts on one column. The Public API honours a single sort key; a later call replaces the earlier one.
Parameters
field
Extract<keyof TRow, string>
direction?
"asc" | "desc"
Returns
this
page()
page(
number):this
1-based page number.
Parameters
number
number
Returns
this
search()
search(
term):this
Full-text keyword search across the seed's searchable branches.
Parameters
term
string
Returns
this
select()
select(
fields):this
Parameters
fields
Extract<keyof TRow, string>[]
Returns
this
where()
where(
filter):this
Parameters
filter
Record<string, FieldFilter>
Returns
this
whereRelation()
whereRelation(
alias,subquery):this
Filters the collection through a declared relation: keeps entries whose alias relation points at any entry of the target seed matching subquery. Depth 1; the server refuses a relation that ?include= could not traverse, and refuses an over-broad subquery with 400.
Parameters
alias
Extract<keyof TRow, string>
subquery
Returns
this