# Cutoff Date

Some [activity selectors](/activity-feeds/docs/react-native/activity-selectors/) have no cutoff by default and scan your feed's entire history on every read. That's fine in development, but with a filter on a large production dataset it becomes a performance risk.

Without a filter, the newest activities are usually enough and the read is fast. Add a filter with no cutoff and the search has no time bound: a selective filter (few or no recent matches) can scan huge amounts of history and time out with a 500, often only after launch once data has grown. A `cutoff_window` bounds the scan, so a selective filter returns "nothing in the window" quickly.

**Rule of thumb:** if a selector uses a filter that runs at read time, set a `cutoff_window`.

## Which selectors need this

| Selector            | Default cutoff   | Set a cutoff when filtering?       |
| ------------------- | ---------------- | ---------------------------------- |
| `following`         | none (unbounded) | No (only fast tag filters allowed) |
| `current_feed`      | none (unbounded) | Yes, with richer filters           |
| `proximity`         | none (unbounded) | Yes                                |
| `follow_suggestion` | none (unbounded) | Yes                                |
| `query`             | 7d               | Recommended if you widen it        |
| `popular`           | 7d               | Recommended if you widen it        |
| `interest`          | 2d               | Recommended if you widen it        |

`current_feed` supports richer filters (`search_data`, `text`, `near`) that force read-time computation: the path a cutoff protects.

## How to set a cutoff

Set `cutoff_window` on the selector: a relative duration ("the last N ..."). Units: `s`, `m`, `h`, `d`, `w`, `y` (for example `"12h"`, `"7d"`, `"2w"`); minimum 1 hour.

<Tabs>

```js label="Node.js"
// Bound a filtered current_feed scan to the last 14 days.
await client.feeds.createFeedGroup({
  id: "team_updates",
  activity_selectors: [
    {
      type: "current_feed",
      filter: {
        search_data: { $contains: { category: "announcement" } },
      },
      cutoff_window: "14d",
    },
  ],
});
```

```python label="Python"
# Bound a filtered current_feed scan to the last 14 days.
response = client.feeds.create_feed_group(
    id="team_updates",
    activity_selectors=[
        {
            "type": "current_feed",
            "filter": {
                "search_data": {"$contains": {"category": "announcement"}},
            },
            "cutoff_window": "14d",
        }
    ],
)
```

```rb label="Ruby"
# Bound a filtered current_feed scan to the last 14 days.
create_request = GetStream::Generated::Models::CreateFeedGroupRequest.new(
  id: 'team_updates',
  activity_selectors: [
    GetStream::Generated::Models::ActivitySelectorConfig.new(
      type: 'current_feed',
      filter: {
        search_data: { '$contains' => { category: 'announcement' } }
      },
      cutoff_window: '14d'
    )
  ]
)

response = client.feeds.create_feed_group(create_request)
```

```php label="PHP"
use GetStream\GeneratedModels\CreateFeedGroupRequest;
use GetStream\GeneratedModels\ActivitySelectorConfig;

// Bound a filtered current_feed scan to the last 14 days.
$response = $feedsClient->createFeedGroup(
    new CreateFeedGroupRequest(
        id: "team_updates",
        activitySelectors: [
            new ActivitySelectorConfig(
                type: "current_feed",
                filter: (object)[
                    'search_data' => (object)[
                        '$contains' => (object)[
                            'category' => 'announcement',
                        ],
                    ],
                ],
                cutoffWindow: "14d"
            )
        ]
    )
);
```

```go label="Go"
// Bound a filtered current_feed scan to the last 14 days.
response, err := client.Feeds().CreateFeedGroup(context.Background(), &getstream.CreateFeedGroupRequest{
  ID: "team_updates",
  ActivitySelectors: []getstream.ActivitySelectorConfig{
    {
      Type: getstream.PtrTo("current_feed"),
      Filter: map[string]any{
        "search_data": map[string]any{
          "$contains": map[string]any{
            "category": "announcement",
          },
        },
      },
      CutoffWindow: getstream.PtrTo("14d"),
    },
  },
})
if err != nil {
  log.Fatal("Error creating feed group:", err)
}
```

```csharp label="C#"
// Bound a filtered current_feed scan to the last 14 days.
var response = await _feedsV3Client.CreateFeedGroupAsync(new CreateFeedGroupRequest
{
    ID = "team_updates",
    ActivitySelectors = new List<ActivitySelectorConfig>
    {
        new()
        {
            Type = "current_feed",
            Filter = new Dictionary<string, object>
            {
                ["search_data"] = new Dictionary<string, object>
                {
                    ["$contains"] = new Dictionary<string, object>
                    {
                        ["category"] = "announcement"
                    }
                }
            },
            CutoffWindow = "14d"
        }
    }
});
```

```java label="Java"
// Bound a filtered current_feed scan to the last 14 days.
Map<String, Object> filter = Map.of(
    "search_data", Map.of(
        "$contains", Map.of("category", "announcement")
    )
);

CreateFeedGroupRequest request = CreateFeedGroupRequest.builder()
    .id("team_updates")
    .activitySelectors(List.of(
        ActivitySelectorConfig.builder()
            .type("current_feed")
            .filter(filter)
            .cutoffWindow("14d")
            .build()
    ))
    .build();

CreateFeedGroupResponse response = feedsClient.createFeedGroup(request).execute().getData();
```

</Tabs>

## Choosing a window

- Match scroll depth: `7d` to `14d` suits most hot feeds; keep older content in search or an archive.
- Narrower filters need shorter windows.
- Start conservative, widen later if needed.

<admonition type="warning">

Set a `cutoff_window` on filtered read-time selectors before production: `current_feed`, `query`, `proximity`, and `follow_suggestion`.

</admonition>


---

This page was last updated at 2026-07-25T05:19:26.660Z.

For the most recent version of this documentation, visit [https://getstream.io/activity-feeds/docs/react-native/cutoff-date/](https://getstream.io/activity-feeds/docs/react-native/cutoff-date/).