npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@prisma-next/mongo

v0.14.0

Published

One-package Mongo setup for Prisma Next

Downloads

28,521

Readme

@prisma-next/mongo

One-package MongoDB setup for Prisma Next. Install this single package to get config, runtime, contract authoring, control-plane access, and BSON value constructors — no reach-ins to internal packages required.

Breaking change: the top-level @prisma-next/mongo barrel (import { ObjectId } from '@prisma-next/mongo') has been removed. Move BSON constructor imports to @prisma-next/mongo/bson:

- import { ObjectId } from '@prisma-next/mongo';
+ import { ObjectId } from '@prisma-next/mongo/bson';

Package Classification

  • Domain: extensions
  • Layer: adapters
  • Planes: shared (config, contract-builder, bson, family, target), migration (control), runtime (runtime)

Quick Start

// prisma-next.config.ts
import { defineConfig } from '@prisma-next/mongo/config';

export default defineConfig({
  contract: './prisma/contract.prisma',
  db: { connection: process.env['MONGODB_URL']! },
});
// prisma/contract.ts
import { defineContract, field, model } from '@prisma-next/mongo/contract-builder';

export default defineContract({
  models: {
    User: model('User', { fields: { id: field.objectId() } }),
  },
});

Exports

@prisma-next/mongo/config

Simplified defineConfig that pre-wires all MongoDB internals (family, target, adapter, driver, contract providers). Accepts contract, db, extensions, and migrations.dir.

import { defineConfig } from '@prisma-next/mongo/config';

export default defineConfig({
  contract: './prisma/contract.prisma',
  db: { connection: process.env['MONGODB_URL']! },
  migrations: { dir: 'migrations/app' },
});

@prisma-next/mongo/contract-builder

TypeScript contract authoring DSL (defineContract, field, model, rel, index, valueObject, …). The defineContract facade pre-binds family and target — callers do not pass those fields.

import { defineContract, field, model } from '@prisma-next/mongo/contract-builder';

export default defineContract({
  models: {
    User: model('User', { fields: { id: field.objectId() } }),
  },
});

@prisma-next/mongo/control

Control-plane client factory. Collapses the family + target + adapter + driver wiring into a single call.

import { createMongoControlClient } from '@prisma-next/mongo/control';

const control = createMongoControlClient({
  connection: process.env['MONGODB_URL']!,
});
await control.dbUpdate({ migrations: { dir: 'migrations/app' } });

@prisma-next/mongo/bson

BSON value constructors for use in seed scripts, fixtures, and tests.

import { ObjectId } from '@prisma-next/mongo/bson';

const id = new ObjectId();

Exports: Binary, Decimal128, Long, MongoClient, ObjectId, Timestamp.

@prisma-next/mongo/runtime

Re-exports createMongoRuntime from @prisma-next/mongo-runtime for composing the MongoDB execution pipeline.

@prisma-next/mongo/family

Re-exports the MongoDB family pack (only needed when using the low-level API; defineContract pre-binds this for you).

@prisma-next/mongo/target

Re-exports the MongoDB target pack (only needed when using the low-level API; defineContract pre-binds this for you).

Dependencies

This package bundles all the transitive dependencies needed for a MongoDB Prisma Next project, including those referenced in the emitted contract.d.ts:

  • @prisma-next/mongo-contract (contract type definitions)
  • @prisma-next/adapter-mongo (adapter + codec types)
  • @prisma-next/contract (shared contract types)

Related Docs

  • Architecture: docs/Architecture Overview.md
  • Subsystem: docs/architecture docs/subsystems/5. Adapters & Targets.md