Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
prisma avatar

Prisma Database Setup Mongodb

  • 12 installs
  • 8 repo stars
  • Updated February 9, 2026
  • prisma/cursor-plugin

prisma-database-setup-mongodb sets Prisma v6 MongoDB schemas with ObjectId ids.

About

The prisma-database-setup-mongodb skill documents MongoDB setup for Prisma with an explicit warning that MongoDB is not supported in Prisma ORM v7 and requires v6.x. Schema uses provider mongodb with url env, prisma-client-js generator, and mandatory @id @map(_id) @db.ObjectId String fields with @default(auto()). Relations require @db.ObjectId on reference fields. Connection strings use mongodb+srv URLs with retryWrites. Migrations do not work; use db push for indexes and db pull for sampling introspection. Common issues cover replica set requirement for transactions and Invalid ObjectID decoration on relation fields.

  • Requires Prisma ORM v6 for MongoDB support.
  • Maps _id with ObjectId String id fields.
  • Uses db push instead of prisma migrate.
  • Documents mongodb+srv DATABASE_URL format.
  • Requires replica set for transaction support.

Prisma Database Setup Mongodb by the numbers

  • 12 all-time installs (skills.sh)
  • Ranked #636 of 911 Databases skills by installs in the Skillselion catalog
  • Data as of Aug 4, 2026 (Skillselion catalog sync)
At a glance

prisma-database-setup-mongodb capabilities & compatibility

Capabilities
v7 unsupported warning · id field @map(_id) requirement · migrations vs db push guidance
Works with
mongodb
Use cases
database
From the docs

What prisma-database-setup-mongodb says it does

MongoDB is NOT supported in Prisma ORM v7
SKILL.md
npx skills add https://github.com/prisma/cursor-plugin --skill prisma-database-setup-mongodb

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs12
repo stars8
Last updatedFebruary 9, 2026
Repositoryprisma/cursor-plugin

How do I configure Prisma with MongoDB?

Configure Prisma v6 MongoDB schemas with ObjectId IDs and replica set requirements.

Who is it for?

Teams on Prisma v6 using MongoDB Atlas or replica sets.

Skip if: Skip when target stack is Prisma ORM v7 only.

When should I use this skill?

User configures Prisma MongoDB datasource and ObjectId models.

What you get

Valid v6 schema, connection string, and db push workflow.

Files

SKILL.mdMarkdownGitHub ↗

MongoDB Setup

⚠️ WARNING: MongoDB is NOT supported in Prisma ORM v7.

Support for MongoDB is planned for a future v7 release. If you need MongoDB, you must use Prisma ORM v6.

Prerequisites

  • MongoDB 4.2+
  • Replica Set configured (required for transactions)
  • Prisma ORM v6.x

1. Schema Configuration (v6)

In prisma/schema.prisma:

datasource db {
  provider = "mongodb"
  url      = env("DATABASE_URL")
}

generator client {
  provider = "prisma-client-js"
}

ID Field Requirement

MongoDB models must have a mapped _id field using @id and @map("_id"), usually of type String with auto() and db.ObjectId.

model User {
  id    String @id @default(auto()) @map("_id") @db.ObjectId
  email String @unique
  name  String?
}

Relations

Relations in MongoDB expect IDs to be db.ObjectId type.

model Post {
  id       String @id @default(auto()) @map("_id") @db.ObjectId
  author   User   @relation(fields: [authorId], references: [id])
  authorId String @db.ObjectId
}

2. Environment Variable

In .env:

DATABASE_URL="mongodb+srv://user:password@cluster.mongodb.net/mydb?retryWrites=true&w=majority"

Migrations vs Introspection

  • No Migrations: MongoDB is schema-less. prisma migrate commands do not work.
  • db push: Use prisma db push to sync indexes and constraints.
  • db pull: Use prisma db pull to generate schema from existing data (sampling).

Common Issues

"Transactions not supported"

Ensure your MongoDB instance is a Replica Set. Standalone instances do not support transactions. Atlas clusters are replica sets by default.

"Invalid ObjectID"

Ensure fields referencing IDs are decorated with @db.ObjectId if the target is an ObjectID.

Related skills

FAQ

What does prisma-database-setup-mongodb do?

prisma-database-setup-mongodb sets Prisma v6 MongoDB schemas with ObjectId ids.

When should I use prisma-database-setup-mongodb?

User configures Prisma MongoDB datasource and ObjectId models.

Is this skill safe to install?

Review the Security Audits panel on this page before installing in production.

Databasesdatabases

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.