prisma-mongodb-upgrade

软件研发 云服务与部署 6 文件 EN 原文

Prisma MongoDB 升级决策与迁移

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".

说明语言:英文

来源prismaskills ↗ 查看原文件 ↗版权归原作者,请遵循原仓库许可
安装
npx skills add https://github.com/prisma/skills --skill prisma-mongodb-upgrade

需要已安装 skills CLI。也可以直接从源仓库 clone。

在星云中查看 ↗
SKILL.md 原文

name: prisma-mongodb-upgrade description: 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". license: MIT metadata: author: prisma version: "0.2.0" ---

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:

The version landscape

VersionMongoDB status
Prisma ORM v6Fully supported (mongodb provider); latest 6.x is the current stable path; maintenance line
Prisma ORM v7No MongoDB connector — not an option, ever
Prisma 8MongoDB 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

SignalDirection
No blockers below applyMigrate to Prisma 8; run the verify-cutover-checklist and share feedback with the Prisma team
Greenfield / prototype / internal toolMigrate to Prisma 8
Codebase uses multi-document transactions ($transaction) — check with grep, do not askPlan 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 candidatesStay on v6 until MongoDB support leaves Early Access
Risk-averse but interestedPoint 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)

Reference files

ReferenceWhat it covers
references/decision-stay-or-migrate.mdThe full decision framing, blocker checks, and stay-hygiene detail
references/schema-contract-mapping.mdv6 schema (mongodb provider, @db.ObjectId, composite types) → Prisma 8 contract concepts
references/client-api-mapping.mdv6 client calls → Prisma 8 equivalents, incl. raw escape hatches and transactions — names map, parity does not
references/migrations-mapping.mdv6 db push-only story → Prisma 8's plan/migrate/verify/sign flow
references/verify-cutover-checklist.mdNo-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.

同类技能
agents-sdkairunway-aks-setupappinsights-instrumentationazure-aiazure-aigatewayazure-app-onboardazure-app-onboard-prereqazure-cloud-migrate
本页内容来自开源项目 prisma, 版权归原作者所有。
本站仅作技能索引与分享,所有 Skill 版权归其原作者所有。