Guides
Task-focused answers for validation, nested objects, references, browser use, and customization.
Guides
Start with the task you are trying to finish. Each guide gives the useful decision or snippet first, followed by detail and a runnable example where it helps.
| I need to… | Guide |
|---|---|
| Run Zod refinements during Mongoose validation | Validate documents |
| Keep or reject unknown object keys | Object modes and unknown keys |
| Control IDs on nested objects | Nested object IDs |
| Reuse a Zod object across files | Reusing object schemas |
| Reference and populate another model | References and population |
| Type populated queries | Strict Model |
| Share schemas with a browser or Nuxt app | Browser and Nuxt |
| Add a plugin or conversion hook | Plugins and hooks |
| Upgrade from older APIs | Migration |
For function signatures and complete type mappings, use the API reference.