> ## Documentation Index
> Fetch the complete documentation index at: https://docs.bijection.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Interface: PopulationQueryInitializer<TableInfo>

> Not exported: an exported type refers to it.

[server](https://docs.bijection.com/api/modules/server).PopulationQueryInitializer

Not exported: an exported type refers to it.

## Type parameters

| Name | Type |
| :- | :- |
| `TableInfo` | extends [`GenericTableInfo`](https://docs.bijection.com/api/modules/server#generictableinfo) |

## Hierarchy

* [`QueryInitializer`](https://docs.bijection.com/api/interfaces/server.QueryInitializer)\<`TableInfo`>

* [`SelectableQuery`](https://docs.bijection.com/api/interfaces/server.SelectableQuery)\<`TableInfo`>

  ↳ **`PopulationQueryInitializer`**

## Properties

### take

• **take**: (`n`: `number`, `options`: [`ReadAvailabilityOptions`](https://docs.bijection.com/api/modules/server#readavailabilityoptions)) => `Promise`\<[`ReadResult`](https://docs.bijection.com/api/modules/server#readresult)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>\[]>>(`n`: `number`) => `Promise`\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>\[]>

#### Type declaration

▸ (`n`, `options`): `Promise`\<[`ReadResult`](https://docs.bijection.com/api/modules/server#readresult)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>\[]>>

##### Parameters

| Name | Type |
| :- | :- |
| `n` | `number` |
| `options` | [`ReadAvailabilityOptions`](https://docs.bijection.com/api/modules/server#readavailabilityoptions) |

##### Returns

`Promise`\<[`ReadResult`](https://docs.bijection.com/api/modules/server#readresult)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>\[]>>

▸ (`n`): `Promise`\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>\[]>

##### Parameters

| Name | Type |
| :- | :- |
| `n` | `number` |

##### Returns

`Promise`\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>\[]>

#### Overrides

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[take](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#take)

***

### collect

• **collect**: (`options`: [`ReadAvailabilityOptions`](https://docs.bijection.com/api/modules/server#readavailabilityoptions)) => `Promise`\<[`ReadResult`](https://docs.bijection.com/api/modules/server#readresult)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>\[]>>() => `Promise`\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>\[]>

#### Type declaration

▸ (`options`): `Promise`\<[`ReadResult`](https://docs.bijection.com/api/modules/server#readresult)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>\[]>>

##### Parameters

| Name | Type |
| :- | :- |
| `options` | [`ReadAvailabilityOptions`](https://docs.bijection.com/api/modules/server#readavailabilityoptions) |

##### Returns

`Promise`\<[`ReadResult`](https://docs.bijection.com/api/modules/server#readresult)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>\[]>>

▸ (): `Promise`\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>\[]>

##### Returns

`Promise`\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>\[]>

#### Overrides

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[collect](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#collect)

***

### first

• **first**: (`options`: [`ReadAvailabilityOptions`](https://docs.bijection.com/api/modules/server#readavailabilityoptions)) => `Promise`\<[`ReadResult`](https://docs.bijection.com/api/modules/server#readresult)\<`null` | [`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>() => `Promise`\<`null` | [`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>

#### Type declaration

▸ (`options`): `Promise`\<[`ReadResult`](https://docs.bijection.com/api/modules/server#readresult)\<`null` | [`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>

##### Parameters

| Name | Type |
| :- | :- |
| `options` | [`ReadAvailabilityOptions`](https://docs.bijection.com/api/modules/server#readavailabilityoptions) |

##### Returns

`Promise`\<[`ReadResult`](https://docs.bijection.com/api/modules/server#readresult)\<`null` | [`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>

▸ (): `Promise`\<`null` | [`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>

##### Returns

`Promise`\<`null` | [`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>

#### Overrides

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[first](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#first)

***

### unique

• **unique**: (`options`: [`ReadAvailabilityOptions`](https://docs.bijection.com/api/modules/server#readavailabilityoptions)) => `Promise`\<[`ReadResult`](https://docs.bijection.com/api/modules/server#readresult)\<`null` | [`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>() => `Promise`\<`null` | [`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>

#### Type declaration

▸ (`options`): `Promise`\<[`ReadResult`](https://docs.bijection.com/api/modules/server#readresult)\<`null` | [`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>

##### Parameters

| Name | Type |
| :- | :- |
| `options` | [`ReadAvailabilityOptions`](https://docs.bijection.com/api/modules/server#readavailabilityoptions) |

##### Returns

`Promise`\<[`ReadResult`](https://docs.bijection.com/api/modules/server#readresult)\<`null` | [`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>

▸ (): `Promise`\<`null` | [`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>

##### Returns

`Promise`\<`null` | [`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>

#### Overrides

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[unique](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#unique)

***

### paginate

• **paginate**: (`paginationOpts`: [`PaginationOptions`](https://docs.bijection.com/api/interfaces/server.PaginationOptions), `options`: [`ReadAvailabilityOptions`](https://docs.bijection.com/api/modules/server#readavailabilityoptions)) => `Promise`\<[`ReadResult`](https://docs.bijection.com/api/modules/server#readresult)\<[`PaginationResult`](https://docs.bijection.com/api/interfaces/server.PaginationResult)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>>(`paginationOpts`: [`PaginationOptions`](https://docs.bijection.com/api/interfaces/server.PaginationOptions)) => `Promise`\<[`PaginationResult`](https://docs.bijection.com/api/interfaces/server.PaginationResult)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>

#### Type declaration

▸ (`paginationOpts`, `options`): `Promise`\<[`ReadResult`](https://docs.bijection.com/api/modules/server#readresult)\<[`PaginationResult`](https://docs.bijection.com/api/interfaces/server.PaginationResult)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>>

##### Parameters

| Name | Type |
| :- | :- |
| `paginationOpts` | [`PaginationOptions`](https://docs.bijection.com/api/interfaces/server.PaginationOptions) |
| `options` | [`ReadAvailabilityOptions`](https://docs.bijection.com/api/modules/server#readavailabilityoptions) |

##### Returns

`Promise`\<[`ReadResult`](https://docs.bijection.com/api/modules/server#readresult)\<[`PaginationResult`](https://docs.bijection.com/api/interfaces/server.PaginationResult)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>>

▸ (`paginationOpts`): `Promise`\<[`PaginationResult`](https://docs.bijection.com/api/interfaces/server.PaginationResult)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>

##### Parameters

| Name | Type |
| :- | :- |
| `paginationOpts` | [`PaginationOptions`](https://docs.bijection.com/api/interfaces/server.PaginationOptions) |

##### Returns

`Promise`\<[`PaginationResult`](https://docs.bijection.com/api/interfaces/server.PaginationResult)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>

#### Overrides

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[paginate](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#paginate)

## Methods

### count

▸ **count**(): `Promise`\<`number`>

#### Returns

`Promise`\<`number`>

#### Inherited from

QueryInitializer.count

***

### limit

▸ **limit**(`n`): [`PopulationQueryInitializer`](https://docs.bijection.com/api/interfaces/server.PopulationQueryInitializer)\<`TableInfo`>

#### Parameters

| Name | Type |
| :- | :- |
| `n` | `number` |

#### Returns

[`PopulationQueryInitializer`](https://docs.bijection.com/api/interfaces/server.PopulationQueryInitializer)\<`TableInfo`>

#### Inherited from

QueryInitializer.limit

***

### groupBy

▸ **groupBy**\<`Path`>(`field`): [`SelectionAnalysis`](https://docs.bijection.com/api/classes/server.SelectionAnalysis)\<`TableInfo`\[`"fieldPaths"`], `true`, `false`, `false`>

Group this selection's samples by one record field.

#### Type parameters

| Name | Type |
| :- | :- |
| `Path` | extends `TableInfo`\[`"fieldPaths"`] |

#### Parameters

| Name | Type |
| :- | :- |
| `field` | [`SeriesSelectionOnly`](https://docs.bijection.com/api/modules/server#seriesselectiononly)\<`TableInfo`, `Path`> |

#### Returns

[`SelectionAnalysis`](https://docs.bijection.com/api/classes/server.SelectionAnalysis)\<`TableInfo`\[`"fieldPaths"`], `true`, `false`, `false`>

#### Inherited from

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[groupBy](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#groupby)

***

### window

▸ **window**(`spec`): [`SelectionAnalysis`](https://docs.bijection.com/api/classes/server.SelectionAnalysis)\<`TableInfo`\[`"fieldPaths"`], `false`, `true`, `false`>

Window this selection's event time on a fixed-duration grid.

#### Parameters

| Name | Type |
| :- | :- |
| `spec` | [`SeriesSelectionOnly`](https://docs.bijection.com/api/modules/server#seriesselectiononly)\<`TableInfo`, [`WindowSpec`](https://docs.bijection.com/api/modules/server#windowspec)> |

#### Returns

[`SelectionAnalysis`](https://docs.bijection.com/api/classes/server.SelectionAnalysis)\<`TableInfo`\[`"fieldPaths"`], `false`, `true`, `false`>

#### Inherited from

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[window](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#window)

***

### signal

▸ **signal**(`policy`): [`SelectionAnalysis`](https://docs.bijection.com/api/classes/server.SelectionAnalysis)\<`TableInfo`\[`"fieldPaths"`], `false`, `false`, `true`>

Interpret one series' samples over the selection's bounded interval.

#### Parameters

| Name | Type |
| :- | :- |
| `policy` | [`SeriesSelectionOnly`](https://docs.bijection.com/api/modules/server#seriesselectiononly)\<`TableInfo`, [`SignalPolicy`](https://docs.bijection.com/api/modules/server#signalpolicy)\<`TableInfo`\[`"fieldPaths"`]>> |

#### Returns

[`SelectionAnalysis`](https://docs.bijection.com/api/classes/server.SelectionAnalysis)\<`TableInfo`\[`"fieldPaths"`], `false`, `false`, `true`>

#### Inherited from

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[signal](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#signal)

***

### explain

▸ **explain**(): [`ReadPath`](https://docs.bijection.com/api/modules/server#readpath)

Inspect the structural plan without consuming the query or deciding authority.

#### Returns

[`ReadPath`](https://docs.bijection.com/api/modules/server#readpath)

#### Inherited from

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[explain](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#explain)

***

### iterate

▸ **iterate**(`options`): `AsyncIterableIterator`\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#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

| Name | Type |
| :- | :- |
| `options` | `Object` |
| `options.prefetch` | `number` |

#### Returns

`AsyncIterableIterator`\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>, `any`, `any`>

#### Inherited from

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[iterate](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#iterate)

***

### aggregate

▸ **aggregate**\<`Measures`, `By`>(`measures`, `options?`): [`AggregateResult`](https://docs.bijection.com/api/modules/server#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

| Name | Type |
| :- | :- |
| `Measures` | extends [`AggregateMeasures`](https://docs.bijection.com/api/modules/server#aggregatemeasures)\<`TableInfo`> |
| `By` | extends `undefined` \| readonly [`DocumentFields`](https://docs.bijection.com/api/modules/server#documentfields)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>\[] = `undefined` |

#### Parameters

| Name | Type |
| :- | :- |
| `measures` | `Measures` |
| `options?` | `TableInfo` extends \{ `nativeSeries`: `true`  } ? `never` : \{ `by`: `By`  } |

#### Returns

[`AggregateResult`](https://docs.bijection.com/api/modules/server#aggregateresult)\<`TableInfo`, `Measures`, `By`>

#### Inherited from

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[aggregate](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#aggregate)

***

### readPage

▸ **readPage**(`options`): `Promise`\<[`QueryReadPage`](https://docs.bijection.com/api/modules/server#queryreadpage)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>

Read one bounded traversal step. This does not register a reactive
page boundary; ordinary read dependencies and current access still apply.

#### Parameters

| Name | Type |
| :- | :- |
| `options` | [`PaginationOptions`](https://docs.bijection.com/api/interfaces/server.PaginationOptions) |

#### Returns

`Promise`\<[`QueryReadPage`](https://docs.bijection.com/api/modules/server#queryreadpage)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>

#### Inherited from

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[readPage](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#readpage)

***

### select

▸ **select**\<`Fields`>(`fields`): [`ProjectedQuery`](https://docs.bijection.com/api/interfaces/server.ProjectedQuery)\<`TableInfo`, `Fields`, `"strict"`>

See [select](https://docs.bijection.com/api/interfaces/server.SelectableOrderedQuery.md#select).

#### Type parameters

| Name | Type |
| :- | :- |
| `Fields` | extends [`DocumentFields`](https://docs.bijection.com/api/modules/server#documentfields)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>> |

#### Parameters

| Name | Type |
| :- | :- |
| `fields` | readonly `Fields`\[] |

#### Returns

[`ProjectedQuery`](https://docs.bijection.com/api/interfaces/server.ProjectedQuery)\<`TableInfo`, `Fields`, `"strict"`>

#### Inherited from

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[select](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#select)

***

### selectCells

▸ **selectCells**\<`Fields`>(`fields`): [`ProjectedQuery`](https://docs.bijection.com/api/interfaces/server.ProjectedQuery)\<`TableInfo`, `Fields`, `"visible"`>

See [selectCells](https://docs.bijection.com/api/interfaces/server.SelectableOrderedQuery.md#selectcells).

#### Type parameters

| Name | Type |
| :- | :- |
| `Fields` | extends [`DocumentFields`](https://docs.bijection.com/api/modules/server#documentfields)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>> |

#### Parameters

| Name | Type |
| :- | :- |
| `fields` | readonly `Fields`\[] |

#### Returns

[`ProjectedQuery`](https://docs.bijection.com/api/interfaces/server.ProjectedQuery)\<`TableInfo`, `Fields`, `"visible"`>

#### Inherited from

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[selectCells](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#selectcells)

***

### visible

▸ **visible**(): [`VisibleQueryInitializer`](https://docs.bijection.com/api/interfaces/server.VisibleQueryInitializer)\<`TableInfo`>

#### Returns

[`VisibleQueryInitializer`](https://docs.bijection.com/api/interfaces/server.VisibleQueryInitializer)\<`TableInfo`>

***

### complete

▸ **complete**(): [`CompleteQueryInitializer`](https://docs.bijection.com/api/interfaces/server.CompleteQueryInitializer)\<`TableInfo`>

#### Returns

[`CompleteQueryInitializer`](https://docs.bijection.com/api/interfaces/server.CompleteQueryInitializer)\<`TableInfo`>

***

### withBudget

▸ **withBudget**(`budget`): [`SelectableQuery`](https://docs.bijection.com/api/interfaces/server.SelectableQuery)\<`TableInfo`>

#### Parameters

| Name | Type |
| :- | :- |
| `budget` | [`ReadBudget`](https://docs.bijection.com/api/modules/server#readbudget) |

#### Returns

[`SelectableQuery`](https://docs.bijection.com/api/interfaces/server.SelectableQuery)\<`TableInfo`>

#### Overrides

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[withBudget](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#withbudget)

***

### collectWithDiagnostics

▸ **collectWithDiagnostics**(): `Promise`\<[`ReadReport`](https://docs.bijection.com/api/modules/server#readreport)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>

#### Returns

`Promise`\<[`ReadReport`](https://docs.bijection.com/api/modules/server#readreport)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>

#### Overrides

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[collectWithDiagnostics](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#collectwithdiagnostics)

***

### takeWithDiagnostics

▸ **takeWithDiagnostics**(`n`): `Promise`\<[`ReadReport`](https://docs.bijection.com/api/modules/server#readreport)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>

#### Parameters

| Name | Type |
| :- | :- |
| `n` | `number` |

#### Returns

`Promise`\<[`ReadReport`](https://docs.bijection.com/api/modules/server#readreport)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>>>

#### Overrides

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[takeWithDiagnostics](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#takewithdiagnostics)

***

### filter

▸ **filter**(`predicate`): [`PopulationQueryInitializer`](https://docs.bijection.com/api/interfaces/server.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

| Name | Type | Description |
| :- | :- | :- |
| `predicate` | (`q`: [`FilterBuilder`](https://docs.bijection.com/api/interfaces/server.FilterBuilder)\<`TableInfo`>) => [`ExpressionOrValue`](https://docs.bijection.com/api/modules/server#expressionorvalue)\<`boolean`> | An [Expression](https://docs.bijection.com/api/classes/server.Expression.md) constructed with the supplied [FilterBuilder](https://docs.bijection.com/api/interfaces/server.FilterBuilder.md) that specifies which documents to keep. |

#### Returns

[`PopulationQueryInitializer`](https://docs.bijection.com/api/interfaces/server.PopulationQueryInitializer)\<`TableInfo`> & \{ `visible`: `never` ; `complete`: `never` ; `withAccessPath`: `never`  }

* A new [OrderedQuery](https://docs.bijection.com/api/interfaces/server.OrderedQuery.md) with the given filter predicate applied.

#### Overrides

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[filter](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#filter)

***

### order

▸ **order**(`order`): [`SelectableOrderedQuery`](https://docs.bijection.com/api/interfaces/server.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

| Name | Type | Description |
| :- | :- | :- |
| `order` | `"asc"` \| `"desc"` | The order to return results in. |

#### Returns

[`SelectableOrderedQuery`](https://docs.bijection.com/api/interfaces/server.SelectableOrderedQuery)\<`TableInfo`>

#### Overrides

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[order](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#order)

***

### require

▸ **require**(`requirement`): [`PopulationQueryInitializer`](https://docs.bijection.com/api/interfaces/server.PopulationQueryInitializer)\<`TableInfo`>

Add source evidence before any terminal read; repeated requirements combine. The table's floor still applies.

#### Parameters

| Name | Type |
| :- | :- |
| `requirement` | [`SourceReadRequirement`](https://docs.bijection.com/api/modules/server#sourcereadrequirement) |

#### Returns

[`PopulationQueryInitializer`](https://docs.bijection.com/api/interfaces/server.PopulationQueryInitializer)\<`TableInfo`>

#### Overrides

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[require](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md#require)

***

### fullTableScan

▸ **fullTableScan**(): [`SelectableQuery`](https://docs.bijection.com/api/interfaces/server.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`](https://docs.bijection.com/api/interfaces/server.SelectableQuery)\<`TableInfo`>

* The [Query](https://docs.bijection.com/api/interfaces/server.Query.md) that iterates over every document of the table.

#### Overrides

[QueryInitializer](https://docs.bijection.com/api/interfaces/server.QueryInitializer.md).[fullTableScan](https://docs.bijection.com/api/interfaces/server.QueryInitializer.md#fulltablescan)

***

### withSpatialIndex

▸ **withSpatialIndex**\<`Name`, `Range`>(`indexName`, `range`): [`SpatialIndexQuery`](https://docs.bijection.com/api/modules/server#spatialindexquery)\<`TableInfo`, `Name`, `Range`>

#### Type parameters

| Name | Type |
| :- | :- |
| `Name` | extends [`SpatialIndexNames`](https://docs.bijection.com/api/modules/server#spatialindexnames)\<`TableInfo`> |
| `Range` | extends [`SpatialRange`](https://docs.bijection.com/api/classes/server.SpatialRange) |

#### Parameters

| Name | Type |
| :- | :- |
| `indexName` | `Name` |
| `range` | (`q`: [`SpatialRangeBuilder`](https://docs.bijection.com/api/modules/server#spatialrangebuilder)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>, [`SpatialPartitions`](https://docs.bijection.com/api/modules/server#spatialpartitions)\<[`NamedIndex`](https://docs.bijection.com/api/modules/server#namedindex)\<`TableInfo`, `Name`>>, [`SpatialField`](https://docs.bijection.com/api/modules/server#spatialfield)\<`TableInfo`, `Name`>>) => `Range` |

#### Returns

[`SpatialIndexQuery`](https://docs.bijection.com/api/modules/server#spatialindexquery)\<`TableInfo`, `Name`, `Range`>

▸ **withSpatialIndex**\<`Name`>(`indexName`): [`SpatialIndexQuery`](https://docs.bijection.com/api/modules/server#spatialindexquery)\<`TableInfo`, `Name`, [`SpatialRangeBuilder`](https://docs.bijection.com/api/modules/server#spatialrangebuilder)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>, [`SpatialPartitions`](https://docs.bijection.com/api/modules/server#spatialpartitions)\<[`NamedIndex`](https://docs.bijection.com/api/modules/server#namedindex)\<`TableInfo`, `Name`>>, [`SpatialField`](https://docs.bijection.com/api/modules/server#spatialfield)\<`TableInfo`, `Name`>>>

#### Type parameters

| Name | Type |
| :- | :- |
| `Name` | extends [`SpatialIndexNames`](https://docs.bijection.com/api/modules/server#spatialindexnames)\<`TableInfo`> |

#### Parameters

| Name | Type |
| :- | :- |
| `indexName` | `Name` |

#### Returns

[`SpatialIndexQuery`](https://docs.bijection.com/api/modules/server#spatialindexquery)\<`TableInfo`, `Name`, [`SpatialRangeBuilder`](https://docs.bijection.com/api/modules/server#spatialrangebuilder)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>, [`SpatialPartitions`](https://docs.bijection.com/api/modules/server#spatialpartitions)\<[`NamedIndex`](https://docs.bijection.com/api/modules/server#namedindex)\<`TableInfo`, `Name`>>, [`SpatialField`](https://docs.bijection.com/api/modules/server#spatialfield)\<`TableInfo`, `Name`>>>

***

### withIndex

▸ **withIndex**\<`IndexName`>(`indexName`, `indexRange?`): [`SelectableQuery`](https://docs.bijection.com/api/interfaces/server.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](https://docs.bijection.com/database/reading-data/indexes/indexes).

#### Type parameters

| Name | Type |
| :- | :- |
| `IndexName` | extends [`IndexNames`](https://docs.bijection.com/api/modules/server#indexnames)\<`TableInfo`> |

#### Parameters

| Name | Type | Description |
| :- | :- | :- |
| `indexName` | `IndexName` | The name of the index to query. |
| `indexRange?` | (`q`: [`IndexRangeBuilder`](https://docs.bijection.com/api/interfaces/server.IndexRangeBuilder)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>, [`NamedIndex`](https://docs.bijection.com/api/modules/server#namedindex)\<`TableInfo`, `IndexName`>>) => [`IndexRange`](https://docs.bijection.com/api/classes/server.IndexRange) | An optional index range constructed with the supplied [IndexRangeBuilder](https://docs.bijection.com/api/interfaces/server.IndexRangeBuilder.md). An index range is a description of which documents Bijection should consider when running the query. If no index range is present, the query will consider all documents in the index. |

#### Returns

[`SelectableQuery`](https://docs.bijection.com/api/interfaces/server.SelectableQuery)\<`TableInfo`>

* The query that yields documents in the index.

#### Overrides

[QueryInitializer](https://docs.bijection.com/api/interfaces/server.QueryInitializer.md).[withIndex](https://docs.bijection.com/api/interfaces/server.QueryInitializer.md#withindex)

***

### withSearchIndex

▸ **withSearchIndex**\<`IndexName`>(`indexName`, `searchFilter`): [`SelectableOrderedQuery`](https://docs.bijection.com/api/interfaces/server.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](https://docs.bijection.com/search/text-search.md).

#### Type parameters

| Name | Type |
| :- | :- |
| `IndexName` | extends [`SearchIndexNames`](https://docs.bijection.com/api/modules/server#searchindexnames)\<`TableInfo`> |

#### Parameters

| Name | Type | Description |
| :- | :- | :- |
| `indexName` | `IndexName` | The name of the search index to query. |
| `searchFilter` | (`q`: [`SearchFilterBuilder`](https://docs.bijection.com/api/interfaces/server.SearchFilterBuilder)\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>, [`NamedSearchIndex`](https://docs.bijection.com/api/modules/server#namedsearchindex)\<`TableInfo`, `IndexName`>>) => [`SearchFilter`](https://docs.bijection.com/api/classes/server.SearchFilter) | A search filter expression constructed with the supplied [SearchFilterBuilder](https://docs.bijection.com/api/interfaces/server.SearchFilterBuilder.md). This defines the full text search to run along with equality filtering to run within the search index. |

#### Returns

[`SelectableOrderedQuery`](https://docs.bijection.com/api/interfaces/server.SelectableOrderedQuery)\<`TableInfo`>

* A query that searches for matching documents, returning them
  in relevancy order.

#### Overrides

[QueryInitializer](https://docs.bijection.com/api/interfaces/server.QueryInitializer.md).[withSearchIndex](https://docs.bijection.com/api/interfaces/server.QueryInitializer.md#withsearchindex)

***

### \[asyncIterator]

▸ **\[asyncIterator]**(): `AsyncIterator`\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>, `any`, `any`>

#### Returns

`AsyncIterator`\<[`DocumentByInfo`](https://docs.bijection.com/api/modules/server#documentbyinfo)\<`TableInfo`>, `any`, `any`>

#### Inherited from

[SelectableQuery](https://docs.bijection.com/api/interfaces/server.SelectableQuery.md).[\[asyncIterator\]](https://docs.bijection.com/api/interfaces/server.SelectableQuery#\[asynciterator])


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.