All skills
prisma avatar

/prisma-mongodb-upgrade

@1864519 official
by prismaprisma/skills66 stars
7

Decision and migration guide for Prisma ORM MongoDB projects on v6, which have no upgrade path to v7. Use when a MongoDB project asks about upgrading Prisma, when "upgrade to prisma 7" comes up in a project with provider = "mongodb", or when evaluating a move to Prisma 8. Triggers on "upgrade prisma mongodb", "prisma 7 mongodb", "mongodb prisma migration", "prisma 8 mongodb".

Use this Skill: https://skilld.dev/gh/prisma/skills/prisma-mongodb-upgrade

This session only. Nothing lands on disk.

referencesdecision-stay-or-migrate.md

≈1k tokens on demand. Your agent reads this file only when SKILL.md points to it.

decision-stay-or-migrate

How to decide between migrating a MongoDB project to Prisma 8 and staying on Prisma v6.

Priority

CRITICAL

Why It Matters

MongoDB projects cannot follow the general "upgrade Prisma" advice: Prisma 7 has no MongoDB connector, so the forward path is Prisma 8. Advising an impossible v7 upgrade, or silently rewriting the app onto SQL, are both serious failure modes. The encouraged path is migrating to Prisma 8 — its MongoDB support is Early Access and the Prisma team wants early adopters' feedback — with a deliberate stay on v6 where a hard blocker applies.

The facts the decision rests on

Prisma 8 side (supported databases, 6 to 8 MongoDB guide):

  • MongoDB support is Early Access in @prisma/orm-mongo; PostgreSQL is a release candidate.
  • The implementation is not a stub: an ORM client, a typed aggregation-pipeline builder, a raw lane, and first-class contract-driven migrations.
  • Prisma 8 has no MongoDB transaction method yet — there is no db.transaction(...) on the MongoDB client. Multi-document atomicity uses the mongodb driver's session API on a replica set. This skill will be updated when a transaction method ships.
  • Early Access means MongoDB behavior can change between release candidates. Floor: Node.js 22.18+, TypeScript 5.9+, MongoDB 8.0+, and mongodb@7.

Prisma v6 side:

  • v6 fully supports MongoDB, including transactions on replica sets — "MongoDB only allows you to start a transaction on a replica set. Prisma ORM uses transactions internally" (replica set configuration).
  • v6 MongoDB has no Prisma Migrate; the workflow is db push (no support for Prisma Migrate).

Blocker checks before migrating

Run these checks yourself — from the codebase, not by asking the user:

  • Search the codebase for $transaction usage (grep for $transaction). If present, plan the raw-driver session equivalents before migrating (see client-api-mapping.md) — or stay on v6 until Prisma 8 adds a MongoDB transaction method.
  • Check the MongoDB server version (must be 8.0+ for Prisma 8; v6 tolerated older).
  • Confirm the team can absorb changes between release candidates. Someone has to follow the release notes and update the code. For a production app, confirm the user accepts Early Access status before migrating.

Bad

User: "We're on Prisma 6 with MongoDB. Should we upgrade to Prisma 7?"
Agent: "Yes — here's the v7 upgrade guide. Step 1: install a driver adapter..."

Prisma 7 has no MongoDB connector; this migration is impossible and the SQL driver-adapter steps corrupt a working v6 setup.

Good

User: "We're on Prisma 6 with MongoDB. Should we upgrade to Prisma 7?"
Agent: "Prisma 7 does not support MongoDB — v6 is the last classic-ORM
major for MongoDB. The path forward is Prisma 8, the successor: its MongoDB support is
Early Access and migrating is encouraged. Let me check the codebase for blockers first —
searching for $transaction usage and checking the MongoDB server version..."

Stay-on-v6 hygiene

Staying is a decision, not a default-by-neglect:

  • Pin prisma and @prisma/client to the latest 6.x and keep taking 6.x patches.
  • Watch Prisma release notes and security advisories for the 6.x maintenance line.
  • Keep the classic setup (url = env("DATABASE_URL") in the schema; db push; no SQL driver adapters).
  • Re-evaluate when Prisma 8's MongoDB support leaves Early Access, or when the blockers are resolved.

References

Source: SKILL.md on GitHub

No alerts1d3 checks · Risk SAFE
  • Gen Agent Trust Hub1d

    This skill is a safe instructional guide for migrating Prisma MongoDB projects from version 6 to Prisma Next. It contains technical reference materials and decision-making logic without any malicious code, obfuscation, or unauthorized data access patterns.

  • Socket1d

    No alerts

  • Snyk1d

    Risk: LOW · No issues

Signed by skilld at 1864519. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub yesterday.

Activeupdated 3 days ago
metadata
{
  "author": "prisma",
  "version": "0.2.0"
}

README badge

README badge for prisma/skills/prisma-mongodb-upgrade