API Overview
High-level reference for Mongster's core exports
Mongster has a deliberately small public surface.
import { , , , , , } from "mongster";The main parts
- Schema layer:
M,defineSchema,M.infer, andM.inferInput. - Client layer:
mongsterandMongsterClient. - Model layer:
model(name, schema)andclient.model(name, schema). - Runtime layer: query builders, populate, aggregation, hooks, and transactions.
- Error layer:
MongsterErrorplus specialized error classes.
Reference pages
- Client —
mongstersingleton and theMongsterClientclass. - Schema Builder —
M.*builders and field-level chainers. - Schema Reference —
MongsterSchemaandObjectSchemaruntime methods. - Model — collection-level method surface.
- Queries —
FindQueryandFindOneQuery. - Aggregate —
AggregateQuerystages and execution. - Errors — error classes, codes, and issue shapes.
Use the pages in this section when you need a quick reference for the shape of an export. Use the guides when you want a workflow or design explanation.