Skip to main content
server.PopulationQueryInitializer Not exported: an exported type refers to it.

Type parameters

Hierarchy

Properties

take

• take: (n: number, options: ReadAvailabilityOptions) => Promise<ReadResult<DocumentByInfo<TableInfo>[]>>(n: number) => Promise<DocumentByInfo<TableInfo>[]>

Type declaration

▸ (n, options): Promise<ReadResult<DocumentByInfo<TableInfo>[]>>
Parameters
Returns
Promise<ReadResult<DocumentByInfo<TableInfo>[]>> ▸ (n): Promise<DocumentByInfo<TableInfo>[]>
Parameters
Returns
Promise<DocumentByInfo<TableInfo>[]>

Overrides

SelectableQuery.take

collect

• collect: (options: ReadAvailabilityOptions) => Promise<ReadResult<DocumentByInfo<TableInfo>[]>>() => Promise<DocumentByInfo<TableInfo>[]>

Type declaration

▸ (options): Promise<ReadResult<DocumentByInfo<TableInfo>[]>>
Parameters
Returns
Promise<ReadResult<DocumentByInfo<TableInfo>[]>> ▸ (): Promise<DocumentByInfo<TableInfo>[]>
Returns
Promise<DocumentByInfo<TableInfo>[]>

Overrides

SelectableQuery.collect

first

• first: (options: ReadAvailabilityOptions) => Promise<ReadResult<null | DocumentByInfo<TableInfo>>>() => Promise<null | DocumentByInfo<TableInfo>>

Type declaration

▸ (options): Promise<ReadResult<null | DocumentByInfo<TableInfo>>>
Parameters
Returns
Promise<ReadResult<null | DocumentByInfo<TableInfo>>> ▸ (): Promise<null | DocumentByInfo<TableInfo>>
Returns
Promise<null | DocumentByInfo<TableInfo>>

Overrides

SelectableQuery.first

unique

• unique: (options: ReadAvailabilityOptions) => Promise<ReadResult<null | DocumentByInfo<TableInfo>>>() => Promise<null | DocumentByInfo<TableInfo>>

Type declaration

▸ (options): Promise<ReadResult<null | DocumentByInfo<TableInfo>>>
Parameters
Returns
Promise<ReadResult<null | DocumentByInfo<TableInfo>>> ▸ (): Promise<null | DocumentByInfo<TableInfo>>
Returns
Promise<null | DocumentByInfo<TableInfo>>

Overrides

SelectableQuery.unique

paginate

• paginate: (paginationOpts: PaginationOptions, options: ReadAvailabilityOptions) => Promise<ReadResult<PaginationResult<DocumentByInfo<TableInfo>>>>(paginationOpts: PaginationOptions) => Promise<PaginationResult<DocumentByInfo<TableInfo>>>

Type declaration

▸ (paginationOpts, options): Promise<ReadResult<PaginationResult<DocumentByInfo<TableInfo>>>>
Parameters
Returns
Promise<ReadResult<PaginationResult<DocumentByInfo<TableInfo>>>> ▸ (paginationOpts): Promise<PaginationResult<DocumentByInfo<TableInfo>>>
Parameters
Returns
Promise<PaginationResult<DocumentByInfo<TableInfo>>>

Overrides

SelectableQuery.paginate

Methods

count

▸ count(): Promise<number>

Returns

Promise<number>

Inherited from

QueryInitializer.count

limit

▸ limit(n): PopulationQueryInitializer<TableInfo>

Parameters

Returns

PopulationQueryInitializer<TableInfo>

Inherited from

QueryInitializer.limit

groupBy

▸ groupBy<Path>(field): SelectionAnalysis<TableInfo["fieldPaths"], true, false, false> Group this selection’s samples by one record field.

Type parameters

Parameters

Returns

SelectionAnalysis<TableInfo["fieldPaths"], true, false, false>

Inherited from

SelectableQuery.groupBy

window

▸ window(spec): SelectionAnalysis<TableInfo["fieldPaths"], false, true, false> Window this selection’s event time on a fixed-duration grid.

Parameters

Returns

SelectionAnalysis<TableInfo["fieldPaths"], false, true, false>

Inherited from

SelectableQuery.window

signal

▸ signal(policy): SelectionAnalysis<TableInfo["fieldPaths"], false, false, true> Interpret one series’ samples over the selection’s bounded interval.

Parameters

Returns

SelectionAnalysis<TableInfo["fieldPaths"], false, false, true>

Inherited from

SelectableQuery.signal

explain

▸ explain(): ReadPath Inspect the structural plan without consuming the query or deciding authority.

Returns

ReadPath

Inherited from

SelectableQuery.explain

iterate

▸ iterate(options): AsyncIterableIterator<DocumentByInfo<TableInfo>, any, any> Iterate with at most this many candidates per native index fetch (1–1024). Use 1 when merging queues so unopened pages are not fetched speculatively. Filters and access checks may require multiple fetches to yield one row.

Parameters

Returns

AsyncIterableIterator<DocumentByInfo<TableInfo>, any, any>

Inherited from

SelectableQuery.iterate

aggregate

▸ aggregate<Measures, By>(measures, options?): AggregateResult<TableInfo, Measures, By> Reduce the whole population before any limit or projection. Work and authorization failures refuse the total rather than returning a partial value.

Type parameters

Parameters

Returns

AggregateResult<TableInfo, Measures, By>

Inherited from

SelectableQuery.aggregate

readPage

▸ readPage(options): Promise<QueryReadPage<DocumentByInfo<TableInfo>>> Read one bounded traversal step. This does not register a reactive page boundary; ordinary read dependencies and current access still apply.

Parameters

Returns

Promise<QueryReadPage<DocumentByInfo<TableInfo>>>

Inherited from

SelectableQuery.readPage

select

▸ select<Fields>(fields): ProjectedQuery<TableInfo, Fields, "strict"> See select.

Type parameters

Parameters

Returns

ProjectedQuery<TableInfo, Fields, "strict">

Inherited from

SelectableQuery.select

selectCells

▸ selectCells<Fields>(fields): ProjectedQuery<TableInfo, Fields, "visible"> See selectCells.

Type parameters

Parameters

Returns

ProjectedQuery<TableInfo, Fields, "visible">

Inherited from

SelectableQuery.selectCells

visible

▸ visible(): VisibleQueryInitializer<TableInfo>

Returns

VisibleQueryInitializer<TableInfo>

complete

▸ complete(): CompleteQueryInitializer<TableInfo>

Returns

CompleteQueryInitializer<TableInfo>

withBudget

▸ withBudget(budget): SelectableQuery<TableInfo>

Parameters

Returns

SelectableQuery<TableInfo>

Overrides

SelectableQuery.withBudget

collectWithDiagnostics

▸ collectWithDiagnostics(): Promise<ReadReport<DocumentByInfo<TableInfo>>>

Returns

Promise<ReadReport<DocumentByInfo<TableInfo>>>

Overrides

SelectableQuery.collectWithDiagnostics

takeWithDiagnostics

▸ takeWithDiagnostics(n): Promise<ReadReport<DocumentByInfo<TableInfo>>>

Parameters

Returns

Promise<ReadReport<DocumentByInfo<TableInfo>>>

Overrides

SelectableQuery.takeWithDiagnostics

filter

▸ filter(predicate): PopulationQueryInitializer<TableInfo> & { visible: never ; complete: never ; withAccessPath: never } Filter the query output, returning only the values for which predicate evaluates to true. Important: Prefer using .withIndex() over .filter() whenever possible. Filters scan all documents matched so far and discard non-matches, while indexes efficiently skip non-matching documents. Define an index in your schema for fields you filter on frequently.

Parameters

Returns

PopulationQueryInitializer<TableInfo> & { visible: never ; complete: never ; withAccessPath: never }
  • A new OrderedQuery with the given filter predicate applied.

Overrides

SelectableQuery.filter

order

▸ order(order): SelectableOrderedQuery<TableInfo> Define the order of the query output. Use "asc" for an ascending order and "desc" for a descending order. If not specified, the order defaults to ascending.

Parameters

Returns

SelectableOrderedQuery<TableInfo>

Overrides

SelectableQuery.order

require

▸ require(requirement): PopulationQueryInitializer<TableInfo> Add source evidence before any terminal read; repeated requirements combine. The table’s floor still applies.

Parameters

Returns

PopulationQueryInitializer<TableInfo>

Overrides

SelectableQuery.require

fullTableScan

▸ fullTableScan(): SelectableQuery<TableInfo> Query by reading all of the values out of this table. This query’s cost is relative to the size of the entire table, so this should only be used on tables that will stay very small (say between a few hundred and a few thousand documents) and are updated infrequently.

Returns

SelectableQuery<TableInfo>
  • The Query that iterates over every document of the table.

Overrides

QueryInitializer.fullTableScan

withSpatialIndex

▸ withSpatialIndex<Name, Range>(indexName, range): SpatialIndexQuery<TableInfo, Name, Range>

Type parameters

Parameters

Returns

SpatialIndexQuery<TableInfo, Name, Range> ▸ withSpatialIndex<Name>(indexName): SpatialIndexQuery<TableInfo, Name, SpatialRangeBuilder<DocumentByInfo<TableInfo>, SpatialPartitions<NamedIndex<TableInfo, Name>>, SpatialField<TableInfo, Name>>>

Type parameters

Parameters

Returns

SpatialIndexQuery<TableInfo, Name, SpatialRangeBuilder<DocumentByInfo<TableInfo>, SpatialPartitions<NamedIndex<TableInfo, Name>>, SpatialField<TableInfo, Name>>>

withIndex

▸ withIndex<IndexName>(indexName, indexRange?): SelectableQuery<TableInfo> Query by reading documents from an index on this table. This query’s cost is relative to the number of documents that match the index range expression. Results will be returned in index order. To learn about indexes, see Indexes.

Type parameters

Parameters

Returns

SelectableQuery<TableInfo>
  • The query that yields documents in the index.

Overrides

QueryInitializer.withIndex

withSearchIndex

▸ withSearchIndex<IndexName>(indexName, searchFilter): SelectableOrderedQuery<TableInfo> Query by running a full text search against a search index. Search queries must always search for some text within the index’s searchField. This query can optionally add equality filters for any filterFields specified in the index. Documents will be returned in relevance order based on how well they match the search text. To learn about full text search, see Indexes.

Type parameters

Parameters

Returns

SelectableOrderedQuery<TableInfo>
  • A query that searches for matching documents, returning them in relevancy order.

Overrides

QueryInitializer.withSearchIndex

[asyncIterator]

▸ [asyncIterator](): AsyncIterator<DocumentByInfo<TableInfo>, any, any>

Returns

AsyncIterator<DocumentByInfo<TableInfo>, any, any>

Inherited from

SelectableQuery.[asyncIterator]