FAQ
Is 0.3.x 100% compatible with 0.2.x?
Public API: yes — same method names, overloads, and peers.
Every behavior bit-identical: no. Defaults on create, $set validation in strict, timestamps: false, and soft: true differ by design.
See Upgrade 0.2 → 0.3.
Is Mondel an ORM or ODM?
ODM (document-oriented). It maps schemas to MongoDB collections with types and validation. It is intentionally thinner than classic ORMs.
Do I need to learn a new query API?
No. Filters and update operators are standard MongoDB. Helpers are thin wrappers (findMany, create, …).
Does Mondel work with MongoDB 8?
Yes. See Compatibility.
Does it work on Cloudflare Workers?
Yes — use serverless: true. You still need network access to Atlas (or compatible). See Workers recipe.
How do I do relations / joins?
Use $lookup in aggregate, or multiple queries in application code. There is no automatic populate.
How do I run migrations?
Mondel manages indexes and optional JSON Schema validators via mondel push.
Data migrations remain your scripts or external tools.
Why is syncIndexes deprecated?
Creating indexes during app startup (especially serverless) causes load spikes and race conditions. Push from CI/deploy instead.
Are reads validated?
No. Validation runs on writes (and optional DB validators). Assume stored data matches the schema, or validate manually with zodSchema.
Can I use both Mongoose and Mondel?
Technically yes on the same database, but avoid dual schema sources of truth. Prefer one stack per collection.
Bundle size?
Mondel is a thin layer; mongodb and zod are peer dependencies and dominate size. Tree-shake with your bundler; mark peers external in libraries.
Is soft delete automatic?
Only when you pass { soft: true }. Default delete is hard delete. You must filter deletedAt yourself on reads.
Where is the AI / LLM doc?
LLM Reference and site /llms.txt.
