# noConvexQueryFilter

Rule `biome/noConvexQueryFilter`. Disallow calling `.filter()` on a Convex database query.

- Source: biome
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 30.6M weekly downloads of presets that enable it
- Trend: +109.3% last quarter
- Rank: #496 by reach, #131 by growth

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `nursery/noConvexQueryFilter` | yes | no | group nursery, since 2.6.10 | [docs](https://biomejs.dev/linter/rules/no-convex-query-filter/) |

## Code examples

### Incorrect: the rule reports this

```js
const messages = await ctx.db
    .query("messages")
    .filter((q) => q.eq(q.field("author"), args.author))
    .collect();
```

```js
const query = ctx.db.query("messages");
const messages = await query.filter((q) => q.eq(q.field("author"), args.author)).collect();
```

### Correct: the rule accepts this

```js
const messages = await ctx.db
    .query("messages")
    .withIndex("by_author", (q) => q.eq("author", args.author))
    .collect();

const allMessages = await ctx.db.query("messages").collect();
const authorMessages = allMessages.filter((message) => message.author === args.author);
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noConvexQueryFilter": "error"
      }
    }
  }
}
```

## Presets that enable it

| Preset | Linter | Package | Rules | Weekly downloads | Trend |
| --- | --- | --- | --- | --- | --- |
| [Biome recommended](https://lintradar.dev/presets/biome-recommended.md) | Biome | `@biomejs/biome` | 491 | 28.5M | +106.8% |
| [Ultracite for Biome](https://lintradar.dev/presets/ultracite-biome.md) | Biome | `ultracite` | 616 | 2.1M | +151.7% |

## Related rules

- [biome/noConvexProcessEnv](https://lintradar.dev/rules/biome/noConvexProcessEnv.md): Disallow `process.env` in Convex functions.
- [biome/noConvexTimeOrRandomInQueries](https://lintradar.dev/rules/biome/noConvexTimeOrRandomInQueries.md): Disallow reading the current time or generating random values in Convex queries.
- [biome/noConvexOldRegisteredFunctionSyntax](https://lintradar.dev/rules/biome/noConvexOldRegisteredFunctionSyntax.md): Require the object syntax when registering Convex queries, mutations, and actions.
- [biome/noConvexTopOfHourCrons](https://lintradar.dev/rules/biome/noConvexTopOfHourCrons.md): Disallow scheduling Convex cron jobs at the start of the hour.
- [biome/noConvexDuplicateIndexes](https://lintradar.dev/rules/biome/noConvexDuplicateIndexes.md): Disallow Convex database indexes whose fields are the first fields of another index on the same table.
- [biome/noDeprecatedMediaType](https://lintradar.dev/rules/biome/noDeprecatedMediaType.md): Disallow deprecated media types.

---

Web page: https://lintradar.dev/rules/biome/noConvexQueryFilter. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
