> 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 range-value based window frame relative to the sort value(s) of the current document.

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

One or more `sort` expressions must be specified on the enclosing [WindowSpec](https://firebase.google.com/docs/reference/js/firestore_lite_pipelines.md.txt#windowspec) when using a `range` window frame. Range frames with numeric or time-unit offsets require a single numeric or timestamp `sort` expression, whereas frames bounded only by `'current'` and `'unbounded'` support multiple `sort` expressions and non-numeric sort values (such as strings or booleans).

**Signature:**

```typescript
export declare interface RangeWindowFrame 
```

## Properties

| Property | Type | Description |
|---|---|---|
| [following](https://firebase.google.com/docs/reference/js/firestore_pipelines.rangewindowframe.md.txt#rangewindowframefollowing) | number \| 'current' \| 'unbounded' \| [Expression](https://firebase.google.com/docs/reference/js/firestore_pipelines.expression.md.txt#expression_class) | ***(Public Preview)*** The upper bound (inclusive) of the window frame, relative to the sort value(s) of the current document.Can be: - A number specifying the value-based offset from the current document's sort value. A positive offset adds to the current document's sort value (looking into the future). A negative offset subtracts from the current document's sort value (shifting the upper boundary before the current document). - `'current'` to include all documents tied with the current document's sort value(s) (peer-inclusive, equivalent to an offset of `0`). - `'unbounded'` to include all documents to the end of the group. |
| [preceding](https://firebase.google.com/docs/reference/js/firestore_pipelines.rangewindowframe.md.txt#rangewindowframepreceding) | number \| 'current' \| 'unbounded' \| [Expression](https://firebase.google.com/docs/reference/js/firestore_pipelines.expression.md.txt#expression_class) | ***(Public Preview)*** The lower bound (inclusive) of the window frame, relative to the sort value(s) of the current document.Can be: - A number specifying the value-based offset from the current document's sort value. A positive offset subtracts from the current document's sort value (looking into the past). A negative offset adds to the current document's sort value (shifting the lower boundary past the current document). - `'current'` to include all documents tied with the current document's sort value(s) (peer-inclusive, equivalent to an offset of `0`). - `'unbounded'` to include all documents from the start of the group. |
| [unit](https://firebase.google.com/docs/reference/js/firestore_pipelines.rangewindowframe.md.txt#rangewindowframeunit) | \| 'microsecond' \| 'millisecond' \| 'second' \| 'minute' \| 'hour' \| 'day' \| 'week' \| 'month' \| 'quarter' \| 'year' \| [Expression](https://firebase.google.com/docs/reference/js/firestore_pipelines.expression.md.txt#expression_class) | ***(Public Preview)*** The unit used to calculate range boundaries when the `sort` field contains date or time values. |

## RangeWindowFrame.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 sort value(s) of the current document.

Can be: - A number specifying the value-based offset from the current document's sort value. A positive offset adds to the current document's sort value (looking into the future). A negative offset subtracts from the current document's sort value (shifting the upper boundary before the current document). - `'current'` to include all documents tied with the current document's sort value(s) (peer-inclusive, equivalent to an offset of `0`). - `'unbounded'` to include all documents to the end of the group.

**Signature:**

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

## RangeWindowFrame.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 sort value(s) of the current document.

Can be: - A number specifying the value-based offset from the current document's sort value. A positive offset subtracts from the current document's sort value (looking into the past). A negative offset adds to the current document's sort value (shifting the lower boundary past the current document). - `'current'` to include all documents tied with the current document's sort value(s) (peer-inclusive, equivalent to an offset of `0`). - `'unbounded'` to include all documents from the start of the group.

**Signature:**

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

## RangeWindowFrame.unit

> 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 unit used to calculate range boundaries when the `sort` field contains date or time values.

**Signature:**

```typescript
unit?:
    | 'microsecond'
    | 'millisecond'
    | 'second'
    | 'minute'
    | 'hour'
    | 'day'
    | 'week'
    | 'month'
    | 'quarter'
    | 'year'
    | Expression;
```