# noConvexCollectInQuery

Rule `biome/noConvexCollectInQuery`. Disallow loading every result of a Convex database query with `.collect()`.

- Source: biome
- Technologies: JavaScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1903 by reach

## Linters

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

## Code examples

### Incorrect: the rule reports this

```js
const messages = await ctx.db.query("messages").collect();
```

```js
const messages = await ctx.db
    .query("messages")
    .withIndex("by_channel", (q) => q.eq("channel", channel))
    .order("desc")
    .collect();
```

### Correct: the rule accepts this

```js
const latest = await ctx.db.query("messages").order("desc").take(10);
const page = await ctx.db.query("messages").paginate(paginationOpts);
const first = await ctx.db.query("messages").first();
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

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

## Related rules

- [biome/noBunModules](https://lintradar.dev/rules/biome/noBunModules.md): Forbid the use of Bun builtin modules.
- [biome/noConvexWrongRuntimeImports](https://lintradar.dev/rules/biome/noConvexWrongRuntimeImports.md): Disallow importing Node.js runtime files from Convex runtime files.
- [biome/noBarrelFile](https://lintradar.dev/rules/biome/noBarrelFile.md): Disallow the use of barrel file.
- [biome/noDisabledAttribute](https://lintradar.dev/rules/biome/noDisabledAttribute.md): Discourages the `disabled` attribute on form controls and on elements that act as buttons.
- [biome/noDrizzleDbObjectInsideTransaction](https://lintradar.dev/rules/biome/noDrizzleDbObjectInsideTransaction.md): Disallow using a Drizzle ORM instance inside its own transaction callback.
- [biome/noExcessiveSelectorClasses](https://lintradar.dev/rules/biome/noExcessiveSelectorClasses.md): Limit the number of classes in a selector.

---

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