Prisma Mongodb Upgrade
PrismaOfficialCreated by prisma
- Skill
- Guidelines
- Software development
- MIT
- No issues found
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
This skill provides a critical decision framework for Prisma ORM users on MongoDB. Because Prisma 7 does not support MongoDB, v6 is the final classic-ORM version for this database. The skill guides users through the transition to Prisma 8, which currently offers MongoDB support in Early Access. It emphasizes that users should not attempt to upgrade to Prisma 7 and provides a structured approach to evaluating whether to migrate to Prisma 8 or maintain a stable v6 environment based on specific project requirements and technical blockers.
What it does
- Explains the version landscape for MongoDB support in Prisma ORM.
- Provides a decision matrix for choosing between migrating to Prisma 8 or staying on v6.
- Outlines hygiene practices for projects choosing to remain on the v6 maintenance line.
- Maps common v6 client API calls to their Prisma 8 equivalents.
- Identifies technical blockers such as multi-document transaction usage.
- Offers a verification checklist for the cutover process.
When to use it
- When a user asks about upgrading a Prisma MongoDB project to version 7.
- When evaluating a migration path from Prisma v6 to Prisma 8 for MongoDB.
- When determining if a project is ready to move to Early Access software.
- When needing to map existing v6 MongoDB client code to the new Prisma 8 API.
Advantages
- Prevents invalid upgrade attempts to unsupported versions.
- Provides clear, actionable criteria for assessing migration readiness.
- Reduces risk by identifying specific code patterns that require refactoring.
- Ensures stable maintenance for projects that cannot yet adopt Early Access features.
Usage examples
- “Should I upgrade my Prisma 6 MongoDB project to version 7?”
- The agent explains that Prisma 7 does not support MongoDB and directs the user to the Prisma 8 migration path, while checking for potential blockers.
- “How do I handle transactions when moving from Prisma 6 to Prisma 8 with MongoDB?”
- The agent clarifies that Prisma 8 does not yet have a native transaction method and provides guidance on using the MongoDB driver's session API.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/prisma/prisma-mongodb-upgrade/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip prisma-mongodb-upgrade.zip -d .agents/skills
Documentation by prisma
Prisma MongoDB Upgrade Path
MongoDB projects are the one Prisma cohort with no road into Prisma 7: v6 is the terminal classic-ORM major for MongoDB, and v7 never ships a MongoDB connector. The successor path is Prisma 8, where MongoDB support is in Early Access while PostgreSQL is a release candidate. The official Prisma ORM 6 to 8 (MongoDB) guide is the source of truth for the migration steps. This skill frames the real decision — migrate to Prisma 8 (the encouraged path), or stay on v6 where a hard blocker applies — and carries the migration mechanics.
Never do either of these:
Never advise a MongoDB project to "upgrade to Prisma 7". The connector does not exist there. The
prisma-upgrade-v7guide does not apply to MongoDB projects.Never solve the version question by rewriting the app onto a SQL database. Changing the database engine is a separate, much larger decision that is not yours to make implicitly.
The version landscape
| Version | MongoDB status |
|---|---|
| Prisma ORM v6 | Fully supported (mongodb provider); latest 6.x is the current stable path; maintenance line |
| Prisma ORM v7 | No MongoDB connector — not an option, ever |
| Prisma 8 | MongoDB support in Early Access through @prisma/orm-mongo; still changes between release candidates — the successor path for MongoDB projects |
The decision, up front
Migrating to Prisma 8 is the encouraged path. MongoDB support in Prisma 8 is Early Access: functional and moving quickly — and the Prisma team wants MongoDB users to migrate early and share feedback. The migration mechanics are detailed in the references.
Staying on the latest v6 remains a legitimate choice where a hard blocker applies —
stated plainly: Prisma 8 has no MongoDB transaction method yet (multi-document writes use
the mongodb driver's sessions directly), and MongoDB behavior can still change between
Prisma 8 release candidates.
Decision table
| Signal | Direction |
|---|---|
| No blockers below apply | Migrate to Prisma 8; run the verify-cutover-checklist and share feedback with the Prisma team |
| Greenfield / prototype / internal tool | Migrate to Prisma 8 |
Codebase uses multi-document transactions ($transaction) — check with grep, do not ask | Plan raw-driver session equivalents first (see client-api-mapping), or stay on v6 until Prisma 8 adds a MongoDB transaction method |
| Team cannot absorb breaking changes between release candidates | Stay on v6 until MongoDB support leaves Early Access |
| Risk-averse but interested | Point Prisma 8 at the v6 schema with prisma6Schema(...) (see schema-contract-mapping), rehearse on a copy (see verify-cutover-checklist), then migrate |
Note: this section will be updated when Prisma 8 adds a MongoDB transaction method.
If staying on v6: hygiene (a deliberate stay, not neglect)
Pin the Prisma packages to the latest 6.x line and keep taking 6.x patch releases.
Track Prisma release notes and security advisories for the 6.x line.
Keep the classic v6 MongoDB setup:
url = env("DATABASE_URL")in the schema,db pushworkflow, no SQL driver adapters (seeprisma-orm-setupfor the v6 MongoDB shape).Re-evaluate when Prisma 8's MongoDB support leaves Early Access, or when the blockers are resolved.
Reference files
| Reference | What it covers |
|---|---|
references/decision-stay-or-migrate.md | The full decision framing, blocker checks, and stay-hygiene detail |
references/schema-contract-mapping.md | v6 schema (mongodb provider, @db.ObjectId, composite types) → Prisma 8 contract concepts |
references/client-api-mapping.md | v6 client calls → Prisma 8 equivalents, incl. raw escape hatches and transactions — names map, parity does not |
references/migrations-mapping.md | v6 db push-only story → Prisma 8's plan/migrate/verify/sign flow |
references/verify-cutover-checklist.md | No-data-moves verification: same DB, index parity, staged round-trip before cutover |
Verified against
Prisma 8 claims in this skill were checked against the
Prisma ORM 6 to 8 (MongoDB) guide,
written for @prisma/orm-mongo 8.0.0-rc.13, and the prisma-8 skill in
prisma/orm at commit
75c1460515fa2f11971533f6a1dec5dab35d4123. MongoDB support still changes between release
candidates: before acting on any Prisma 8 claim, check the installed version
(npm ls @prisma/orm-mongo) and its synced prisma-8 skill.
Prisma 8 on MongoDB requires Node.js 22.18+ (24.11+ on the 24 line; 24 recommended),
TypeScript 5.9+, MongoDB 8.0+, and mongodb@7 as a peer dependency. The mongodb@7 driver
no longer accepts AWS credentials in the connection string.
Hand-off rule
This skill is the discovery bridge, not a replacement for Prisma 8's own
documentation. After a project switches to Prisma 8, run prisma skills sync, read the
synced prisma-8/SKILL.md, and follow it for day-to-day work — do not keep working from
this skill's summaries.
Files
- ATTRIBUTION.mdAdded by AutoGineer882 B
- LICENSELicence file added by AutoGineer1.0 KiB
- SKILL.md5.7 KiB
- references/client-api-mapping.md4.1 KiB
- references/decision-stay-or-migrate.md4.0 KiB
- references/migrations-mapping.md3.5 KiB
- references/schema-contract-mapping.md4.3 KiB
- references/verify-cutover-checklist.md3.2 KiB
references/verify-cutover-checklist.md
verify-cutover-checklist
Verification checklist for a v6 → Prisma 8 cutover: the data never moves — only the code does.
Priority
CRITICAL
Why It Matters
A v6 → Prisma 8 migration is a client and workflow migration against the same MongoDB database — there is no data export/import step, and introducing one (or pointing the new stack at a fresh database) turns a code migration into an outage. The checklist below keeps the cutover observable and reversible.
Ground rules
No data moves. The Prisma 8 contract is authored to describe the existing collections; both stacks read the same database during the staged phase.
v6 stays runnable until cutover is verified. Do not delete the v6 client, schema, or dependencies until the checklist passes.
Checklist
Same database, verified: the Prisma 8 config points at the same connection string / database name the v6 app uses. The
mongodb@7driver rejects some URLs v6 accepted, such as AWS credentials in the connection string — validate the URL with the driver first.Server floor: MongoDB server is 8.0+ (Prisma 8's requirement; v6 tolerated older). Confirm before authoring any contract.
Rehearsal on a copy: on a throwaway copy of the database, run
contract emit,db update --dry-run,db update, anddb verify, and confirmdb verifypasses before touching production. Verification failures here are contract-mapping bugs, not database problems.Index parity: enumerate indexes on every collection (
db.collection.getIndexes()) and confirm the Prisma 8 contract declares the same set — v6db pushmay have created indexes the new contract must re-declare, or verification and query performance will diverge.Validator impact assessed: Prisma 8 emits closed
$jsonSchemavalidators by default; confirm legacy documents (extra fields, drifted shapes) pass them on the staging copy before applying to production.Storage-name addressing audited: every ported call site uses collection storage names (
db.orm.users), not model names (seeschema-contract-mapping.md).Transaction inventory mapped: grep the v6 app for
$transaction; each hit gets amongodbdriver-session equivalent on a replica set (seeclient-api-mapping.md).Raw call inventory mapped: every
$runCommandRaw/findRaw/aggregateRawcall has an explicit Prisma 8 replacement (db.raw,db.query.rawCommand(...), the pipeline builder, or the sharedMongoClient).Staged read-only soak: run the Prisma 8 stack read-only against staging/production data alongside v6 and compare outputs before allowing writes.
Cutover + rollback: switch writes to Prisma 8 only after the soak; keep the v6 branch deployable as the rollback path. Rolling back is a code rollback — the data was never moved.
After cutover, follow the synced prisma-8 skill for ongoing work (see the hand-off rule
in SKILL.md).
References
Requirements and compatibility
Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta
“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.
Security
No issues found by our static scan· No issues found
A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.
Attribution and licence
- Created by
- prisma
- Publisher
- Prisma (Official)
- Source
- prisma/skills · prisma-mongodb-upgrade · commit 8ea289b
- Licence
- MIT License (redistribution allowed)
- LICENSE (added by AutoGineer from LICENSE)
- ATTRIBUTION.md (written by AutoGineer)
- Synced
AutoGineer is not affiliated with or endorsed by prisma.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download prisma-mongodb-upgrade.zip