Mongster

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, and M.inferInput.
  • Client layer: mongster and MongsterClient.
  • Model layer: model(name, schema) and client.model(name, schema).
  • Runtime layer: query builders, populate, aggregation, hooks, and transactions.
  • Error layer: MongsterError plus specialized error classes.

Reference pages

  • Clientmongster singleton and the MongsterClient class.
  • Schema BuilderM.* builders and field-level chainers.
  • Schema ReferenceMongsterSchema and ObjectSchema runtime methods.
  • Model — collection-level method surface.
  • QueriesFindQuery and FindOneQuery.
  • AggregateAggregateQuery stages 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.

On this page