Prisma Client is an auto-generated, type-safe and modern JavaScript/TypeScript ORM for Node.js that's tailored to your data. Supports PostgreSQL, CockroachDB, MySQL, MariaDB, SQL Server, SQLite & MongoDB databases.
Last release 5 days ago
27 Aug 2026
Ships fairly regularly
a new release about every 1 weeks
Nearly every release is documented
notes for 60 of the last 60 stable releases
3 versions withdrawn
withdrawn after publishing
7 years old
10653 releases · first in 2020
One column per quarter.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Today, we are excited to share the 3.10.0 stable release 🎉
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
We are working towards a stable release of MongoDB and are shipping lots of improvements. All the new features and changes in this release therefore only apply to the MongoDB connector. Take a closer look if you are using the Preview of MongoDB as some of the changes are breaking.
We're super excited to announce that Prisma version 3.10.0 supports reading and modifying embedded documents. Embedded documents will provide access to a new type keyword in your Prisma schema that you can use to define composite types.
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["mongoDb"]
}
model Product {
id String @id @default(auto()) @map("_id") @db.ObjectId
name String
photos Photo[]
}
type Photo {
height Int
width Int
url String
}
Given the schema above, you can now read and write to the embedded photos array:
// Create a new product with an embedded list of photos
const product = await prisma.product.create({
data: {
name: "Forest Runners",
// Create an embedded list of photos in the product
photos: [
{ height: 100, width: 200, url: "1.jpg" },
{ height: 300, width: 400, url: "2.jpg" },
],
},
})
Best of all, the query is entirely type-safe! This scratches the surface of what's possible with embedded documents. You can read further in our documentation.
If you run into anything, feel free to open an issue, and we’ll give you a hand!
We added Preview support for Introspection of embedded documents in version 3.4.0 and are now activating it for all users. Running prisma db pull against your MongoDB database will generate type definitions within your Prisma schema.
When introspecting your database, you can switch off the depth with --composite-type-depth=0, or limit it with, for example, --composite-type-depth=2.
Feel free to drop your feedback on the feature on GitHub.
@default(dbgenerated()) is now replaced with @default(auto())The original purpose of dbgenerated is to support SQL expressions Prisma doesn’t understand yet. However, MongoDB doesn’t have a concept of default value expressions like SQL does. We took this opportunity to simplify how we handle the default values in MongoDB:
model Post {
- id String @id @default(dbgenerated()) @map("_id") @db.ObjectId
+ id String @id @default(auto()) @map("_id") @db.ObjectId
}
references argumentPrisma version 3.10.0 now enforces all arguments in a MongoDB many-to-many relation. This means a @relation attribute must define fields and references arguments on both sides.
The fields argument must point to a scalar field in the same model, and this scalar field must be an array. The references arguments must point to a scalar field in the opposite model, and it must be a singular type of the same base type as the referencing array on the other side.
model Post {
id String @id @map("_id") @default(auto()) @db.ObjectId
category_ids String[] @db.ObjectId
- categories Category[] @relation(fields: [category_ids])
+ categories Category[] @relation(fields: [category_ids], references: [id])
}
model Category {
id String @id @map("_id") @default(auto()) @db.ObjectId
post_ids String[] @db.ObjectId
- posts Post[] @relation(fields: [post_ids])
+ posts Post[] @relation(fields: [post_ids], references: [id])
}
@db.Array(ObjectId) is now updated to @db.ObjectIdWe've adjusted the Prisma schema format for scalar lists with native types (like lists of Object IDs). This will likely affect those with many-to-many relationships in MongoDB. We made this change to align MongoDB with our existing SQL databases better:
model Post {
id String @id @default(auto()) @map("_id") @db.ObjectId
- categoryIDs String[] @db.Array(ObjectId)
+ categoryIDs String[] @db.ObjectId
categories Category[] @relation(fields: [categoryIDs], references: [id])
}
model Category {
id String @id @default(auto()) @map("_id") @db.ObjectId
- postIDs String[] @db.Array(ObjectId)
+ postIDs String[] @db.ObjectId
posts Post[] @relation(fields: [postIDs], references: [id])
}
@db.ObjectId isn't presentdatasource blocksprisma init --url does not like mongodb+srv://Code 19 and unformatted list output during Re-Introspectionid_ special caseUnsupported("Unknown") causes schema validation to crash@db.Array(ObjectId) to @db.ObjectIdUnsupported(...) fields are not rejected on composite types@default(autoincrement())Option::unwrap() on a None value _id of type ObjectId are introspected without native type @db.ObjectId@default(dbgenerated()) with @default(auto())prisma db pull doesn't read .env file and errors with Environment variable not found: DATABASE_URLModel "undefined", field: ...Multiple data types found: Array(Array(Array(Double))): 86.2%, Array(Array(Array(Array(Double)))): 13.8% out of 195 sampled entriesInteractiveTransaction: Middleware param runInTransaction set to false.count does not work with whereinteractiveTransactions feature breaks long running transactionsa_ids String[] @db.ObjectId3.9.1prisma as driverInfo to MongoDBHuge thanks to @andyrichardson, @xnerhu, @Josh-a-e, @dusandz, @hyochan, @cesconix, @benkroeger, @YassinEldeeb, @chenkie for helping!
Learn about the latest release and other news from the Prisma community by joining us for another "What's new in Prisma" livestream.
The stream takes place on YouTube on Thursday, February 03 at 5 pm Berlin | 8 am San Francisco.
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version
Nothing published for this version