Mondel is a lightweight TypeScript ORM for MongoDB, optimized for serverless environments (Cloudflare Workers, Vercel Edge, AWS Lambda). Current stable version is 0.2.4. It provides 100% type-safe schemas with full inference, Zod integration for runtime validation, and a Prisma/Drizzle-inspired API. Unlike Mongoose or Typegoose, it uses zero decorators or reflection, resulting in a minimal bundle (~27KB) and no cold-start overhead. It requires Node.js 18+, MongoDB 6.0+, and TypeScript 5.0+.
npm install mondelNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Complete example: define schema, create serverless client, perform CRUD, close connection.
Use import { defineSchema, createClient, s } from 'mondel' instead of from 'mondel/schema' etc.For persistent connections in non-serverless env, set serverless: false or omit.
Use s.enum(['A', 'B'] as const) or define a const enum.
Always pass a filter object; use {} to match all.Use 'name' instead of 'collection'; update field definitions to new builder pattern.
Ensure you pass all schema definitions in the 'schemas' array to createClient and that the type includes them.
Use .updateOne with upsert: true or check existence first.
Run npm install mongodb zod since they are peer dependencies.
Provide at least an empty filter object: db.users.findOne({}, { select: { name: true } })