# v2.0.1 — 2026-06-03

## Overview

v2.0.1 is a compatibility and documentation patch for the v2 TypeScript line. It preserves the v2.0.0 public package shape while tightening v1 smooth-upgrade behavior and aligning the published documentation with the current runtime.

---

## Fixes

- **Model routing:** `definition.collection` is now used as the actual MongoDB collection name, with `definition.name` and the registered model name as fallbacks.
- **Model pool scope:** Model connection metadata now routes through the configured pool and database when creating scoped collections.
- **Model cache identity:** Model instance cache keys include pool, database, registered model name, and actual collection name to avoid cross-scope reuse.
- **Populate compatibility:** `relations.from` resolves registered Model names to their actual MongoDB collection names, while still allowing direct collection names when no registered Model exists.
- **Automatic indexes:** Model index creation is deduplicated per runtime / pool / database / collection / index fingerprint; pending and fulfilled tasks are reused, while failed tasks may retry.
- **Cache compatibility:** Runtime cache option normalization preserves v1 aliases and millisecond TTL semantics.
- **Pool compatibility:** Pool selector operation names accept v1-style string inputs.

---

## Documentation and Types

- Added `ModelDefinition.collection` and `ModelDefinition.name` to the public type surface.
- Documented the actual automatic-index flow: `connect()` only registers models; `ModelInstance` creation schedules per-index `createIndex()` calls; no `listIndexes()` preflight is performed.
- Updated the current release status, API index count, examples count, and advanced capability index entries.
- Kept historical changelog archive links unchanged; current published package links remain clean.

---

## Validation

- `npm run build`
- `npm run type-check`
- `npm run lint`
- `npm run test:runtime`
- `npm run test:compatibility`
- `npm run check:sizes:strict`
- `npm run test:examples`
- `npm pack --json --dry-run`
