> ## 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: ProjectedOrderedQuery<TableInfo, Fields>

> A query whose output has been projected, with an order already defined.

[server](/api/modules/server).ProjectedOrderedQuery

A query whose output has been projected, with an order already defined.

It is not a [OrderedQuery](/api/interfaces/server.OrderedQuery): its documents are the projection, so
assigning one to `OrderedQuery<TableInfo>` would claim properties that were
never requested and are not evaluated.

## Type parameters

| Name | Type |
| :- | :- |
| `TableInfo` | extends [`GenericTableInfo`](/api/modules/server#generictableinfo) |
| `Fields` | extends `string` |

## Hierarchy

* `AsyncIterable`\<[`SelectedDocument`](/api/modules/server#selecteddocument)\<[`DocumentByInfo`](/api/modules/server#documentbyinfo)\<`TableInfo`>, `Fields`>>

  ↳ **`ProjectedOrderedQuery`**

  ↳↳ [`ProjectedQuery`](/api/interfaces/server.ProjectedQuery)

## Methods

### filter

▸ **filter**(`predicate`): [`ProjectedOrderedQuery`](/api/interfaces/server.ProjectedOrderedQuery)\<`TableInfo`, `Fields`>

Filter the projected query's output. The predicate still evaluates the
original document, including properties the projection omits, so a filter
means exactly what it means on an unprojected query.

#### Parameters

| Name | Type |
| :- | :- |
| `predicate` | (`q`: [`FilterBuilder`](/api/interfaces/server.FilterBuilder)\<`TableInfo`>) => [`ExpressionOrValue`](/api/modules/server#expressionorvalue)\<`boolean`> |

#### Returns

[`ProjectedOrderedQuery`](/api/interfaces/server.ProjectedOrderedQuery)\<`TableInfo`, `Fields`>

***

### paginate

▸ **paginate**(`paginationOpts`): `Promise`\<[`PaginationResult`](/api/interfaces/server.PaginationResult)\<[`SelectedDocument`](/api/modules/server#selecteddocument)\<[`DocumentByInfo`](/api/modules/server#documentbyinfo)\<`TableInfo`>, `Fields`>>>

Load a page of projected results.

#### Parameters

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

#### Returns

`Promise`\<[`PaginationResult`](/api/interfaces/server.PaginationResult)\<[`SelectedDocument`](/api/modules/server#selecteddocument)\<[`DocumentByInfo`](/api/modules/server#documentbyinfo)\<`TableInfo`>, `Fields`>>>

***

### collect

▸ **collect**(): `Promise`\<[`SelectedDocument`](/api/modules/server#selecteddocument)\<[`DocumentByInfo`](/api/modules/server#documentbyinfo)\<`TableInfo`>, `Fields`>\[]>

Return all of the projected results as an array.

#### Returns

`Promise`\<[`SelectedDocument`](/api/modules/server#selecteddocument)\<[`DocumentByInfo`](/api/modules/server#documentbyinfo)\<`TableInfo`>, `Fields`>\[]>

***

### take

▸ **take**(`n`): `Promise`\<[`SelectedDocument`](/api/modules/server#selecteddocument)\<[`DocumentByInfo`](/api/modules/server#documentbyinfo)\<`TableInfo`>, `Fields`>\[]>

Return the first `n` projected results.

#### Parameters

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

#### Returns

`Promise`\<[`SelectedDocument`](/api/modules/server#selecteddocument)\<[`DocumentByInfo`](/api/modules/server#documentbyinfo)\<`TableInfo`>, `Fields`>\[]>

***

### first

▸ **first**(): `Promise`\<`null` | [`SelectedDocument`](/api/modules/server#selecteddocument)\<[`DocumentByInfo`](/api/modules/server#documentbyinfo)\<`TableInfo`>, `Fields`>>

Return the first projected result, or `null`.

#### Returns

`Promise`\<`null` | [`SelectedDocument`](/api/modules/server#selecteddocument)\<[`DocumentByInfo`](/api/modules/server#documentbyinfo)\<`TableInfo`>, `Fields`>>

***

### unique

▸ **unique**(): `Promise`\<`null` | [`SelectedDocument`](/api/modules/server#selecteddocument)\<[`DocumentByInfo`](/api/modules/server#documentbyinfo)\<`TableInfo`>, `Fields`>>

Return the single projected result, or `null`; throw if there are more.

#### Returns

`Promise`\<`null` | [`SelectedDocument`](/api/modules/server#selecteddocument)\<[`DocumentByInfo`](/api/modules/server#documentbyinfo)\<`TableInfo`>, `Fields`>>

***

### \[asyncIterator]

▸ **\[asyncIterator]**(): `AsyncIterator`\<[`SelectedDocument`](/api/modules/server#selecteddocument)\<[`DocumentByInfo`](/api/modules/server#documentbyinfo)\<`TableInfo`>, `Fields`>, `any`, `undefined`>

#### Returns

`AsyncIterator`\<[`SelectedDocument`](/api/modules/server#selecteddocument)\<[`DocumentByInfo`](/api/modules/server#documentbyinfo)\<`TableInfo`>, `Fields`>, `any`, `undefined`>

#### Inherited from

AsyncIterable.\[asyncIterator]
