> Documentation index: https://firebase.google.com/docs/reference/js/llms.txt

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

Defines a document-count based window frame relative to the position of the current document in the group.

Window Functions SDK features are in preview until the backend feature launches. Look for launch announcement at: https://docs.cloud.google.com/firestore/docs/release-notes

Specifying `sort` on the enclosing [WindowSpec](https://firebase.google.com/docs/reference/js/firestore_pipelines.md.txt#windowspec) is optional for `documents` window frames; if no `sort` expressions are specified, documents are processed in incoming stream (fetch) order.

**Signature:**

```typescript
export declare interface DocumentWindowFrame 
```

## Properties

| Property | Type | Description |
|---|---|---|
| [following](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines.documentwindowframe.md.txt#documentwindowframefollowing) | number \| 'current' \| 'unbounded' \| [Expression](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines.expression.md.txt#expression_class) | ***(Public Preview)*** The upper bound (inclusive) of the window frame, relative to the current document's position.Can be: - A number specifying a document offset relative to the current document. A positive integer (e.g. `2`) includes up to that many documents after the current document. A negative integer (e.g. `-1`) indicates a boundary preceding the current document, enabling frames that end before the current document (e.g. excluding the current document). - `'current'` to represent the current document's position only (documents tied on sort values are not included). - `'unbounded'` to include all documents to the last document in the group. |
| [preceding](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines.documentwindowframe.md.txt#documentwindowframepreceding) | number \| 'current' \| 'unbounded' \| [Expression](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines.expression.md.txt#expression_class) | ***(Public Preview)*** The lower bound (inclusive) of the window frame, relative to the current document's position.Can be: - A number specifying a document offset relative to the current document. A positive integer (e.g. `2`) includes up to that many documents before the current document. A negative integer (e.g. `-1`) indicates a boundary following the current document, enabling frames that start after the current document. - `'current'` to represent the current document's position only (documents tied on sort values are not included). - `'unbounded'` to include all documents from the first document in the group. |

## DocumentWindowFrame.following

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

The upper bound (inclusive) of the window frame, relative to the current document's position.

Can be: - A number specifying a document offset relative to the current document. A positive integer (e.g. `2`) includes up to that many documents after the current document. A negative integer (e.g. `-1`) indicates a boundary preceding the current document, enabling frames that end before the current document (e.g. excluding the current document). - `'current'` to represent the current document's position only (documents tied on sort values are not included). - `'unbounded'` to include all documents to the last document in the group.

**Signature:**

```typescript
following: number | 'current' | 'unbounded' | Expression;
```

## DocumentWindowFrame.preceding

> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.

The lower bound (inclusive) of the window frame, relative to the current document's position.

Can be: - A number specifying a document offset relative to the current document. A positive integer (e.g. `2`) includes up to that many documents before the current document. A negative integer (e.g. `-1`) indicates a boundary following the current document, enabling frames that start after the current document. - `'current'` to represent the current document's position only (documents tied on sort values are not included). - `'unbounded'` to include all documents from the first document in the group.

**Signature:**

```typescript
preceding: number | 'current' | 'unbounded' | Expression;
```