Mongster

Recipes

Mongster can be used with most typescript backend frameworks

Mongster does not need a special framework adapter. The pattern is usually the same everywhere:

  1. define the schema and model in a server-only module,
  2. connect once during app startup,
  3. reuse the model from route handlers, server functions, or actions.

The recipes in this section show that pattern in a few common stacks.

Available recipes

  • With Hono — wire models into Hono route handlers and middleware.
  • With TanStack Start — load schemas and call models from createServerFn functions.
  • With Next.js — server components, route handlers, and server actions against a shared model module.
  • With Fresh (Deno) — Deno-native usage inside Fresh routes and islands.

If your framework is not listed, follow the three-step pattern above. Mongster is just a typed wrapper over the official MongoDB driver, so any Node-, Bun-, or Deno-compatible runtime works the same way.

On this page