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
Today, we are issuing the 3.11.1 patch release.
undefined fields by defaultIn 3.11.1, we've changed what data is returned when filtering MongoDB documents on undefined fields. The new rule is that undefined fields are excluded by default unless explicitly filtered for. This allows you to query for undefined and null values separately.
Let's take a look at a concrete example. Given the following Prisma schema:
model Address {
id Int @id @map("_id")
city String
street String? // Note that street is optional
}
For Mongo, optional fields can either be null or undefined (absent). The following documents are all valid for the schema above:
{ "_id": 1, "city": "San Fransisco", "street": "Market st." }
{ "_id": 2, "city": "Seattle", "street": null }
{ "_id": 3, "city": "Chicago" }
Prior to 3.11.1, if you queried for where: { street: null }, you'd get _id: 2 and _id: 3. In 3.11.1, you'll only get _id: 2. The ability to also query for the missing fields has also been added. For details, refer to the new isSet below to learn more.
There are a few exceptions to this new default:
having filter on an aggregated field will return undefined fields. This is because aggregation on undefined fields yields null, not undefined, thus matching the filter.undefined) will currently include those relations in the result set.isSet filter operationTo compensate for missing fields on documents no longer being returned by the filters above, we’ve added a new isSet: bool filter. This filter can be used to include fields that are undefined on documents.
Using the example above, to include the undefined fields, you can use an OR:
await prisma.address.findMany({
where: {
OR: [
{ street: { isSet: false } },
{ street: null }
]
}
})
The isSet operation has been added to all scalar and embedded fields that are optional.
unset operationIn 3.11.1, you can also remove a field with the unset operation.
Using the example above, let's write a query to remove the street field:
await prisma.address.update({
where: {
id: 10,
},
data: {
street: {
unset: true,
},
},
})
This effectively sets the street field to undefined in the database.
updateMany operationWe now support updating embedded documents that match specific criteria.
For example, given the following schema:
model Product {
id Int @id @map("_id")
name String @unique
photos Photo[]
}
type Photo {
height Int @default(200)
width Int @default(100)
url String
}
Let's update the photo with a url of 1.jpg to 2.png:
const product = prisma.product.update({
where: {
id: 10,
},
data: {
photos: {
updateMany: {
where: {
url: '1.jpg',
},
data: {
url: '2.png',
},
},
},
},
})
deleteMany operationSimilar to updateMany, you can also remove embeds that match specific criteria.
Using the Prisma Schema above, let's delete all photos with a height of 100:
const product = prisma.product.update({
where: {
id: 10,
},
data: {
photos: {
deleteMany: {
where: {
height: 100,
},
},
},
},
})
Nothing published for this version
Nothing published for this version
Nothing published for this version
Today, we are excited to share the 3.11.0 stable release 🎉
🌟 Help us spread the word about Prisma by starring the repo or tweeting about the release. 🌟
In the previous release, we added embedded document support for creates, updates, and deletes. In version 3.11.0, we’re adding the ability to filter embedded documents.
Given the following schema:
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
photos Photo[]
}
model Order {
id String @id @default(auto()) @map("_id") @db.ObjectId
shippingAddress Address
billingAddress Address?
}
type Photo {
height Int
width Int
url String
}
type Address {
street String
city String
zip String
}
You can now filter within an embedded document:
// find all orders with the same shipping address
const orders = await prisma.order.findMany({
where: {
shippingAddress: {
equals: {
street: "555 Candy Cane Lane",
city: "Wonderland",
zip: "52337",
},
},
},
})
You can also filter on a "contains many" relationship:
// find all products that don't have photos
const product = prisma.product.findMany({
where: {
photos: {
isEmpty: true
}
},
})
This scratches the surface of what's possible. For a complete list of available operations, have a look at our documentation. Please share your feedback in this issue.
In addition to filtering, Prisma version 3.11.0 now supports sorting by an embedded document.
Using the example schema above, you can sort orders by their zip code:
// sort orders by zip code in ascending order
const orders = await prisma.order.findMany({
orderBy: {
shippingAddress: {
zip: "asc",
},
},
})
Learn more about this feature in our documentation and don’t hesitate to reach out in this issue.
In this release, we’ve added the ability to log MongoDB queries. You can enable query logging in the PrismaClient constructor:
const prisma = new PrismaClient({
log: [
{
emit: 'event',
level: 'query',
},
]
})
prisma.$on('query', (e) => console.log(e.query))
After enabling query logging, you'll start to see logs that resemble this in your console:
db.User.deleteMany({ _id: ( $in: [ “62261e0b18139c6099ba7097”, ], }, })
db.User.deleteMany({ _id: ( $in: [ “6226277a96069500743edcf9”, ], }, })
The logs output by Prisma have the same format as the mongosh console, so you can pipe the queries from your logs directly into your shell.
We've updated the type inference behavior for MongoDB on introspection.
Prisma samples a field's data to select an appropriate type on introspection. In the past, Prisma picked the type used most often for fields with data with multiple types. However, this could cause problems when retrieving mixed data during runtime and throw exceptions, such as Prisma Studio or in Prisma Client queries.
From 3.11.0, Prisma defaults to the Json type to all fields with mixed data types instead. Additionally, Prisma will still show a warning on the console and add a comment to the introspected Prisma schema so it is clear where such cases occur and that you can do something to fix them.
In 3.11.0, we’ve rewritten our internal logger to reduce lock contention and enable future features like tracing. This is the first of many upcoming changes to improve the Prisma Client’s throughput, so if you were running into an upper limit on query performance, it’s time to update Prisma Client and give it a try!
If you're running into query performance issues, please open an issue or connect with us on Slack.
We're excited to announce Preview support for migrations for CockroachDB. You can now evolve your Prisma schema and propagate the changes to your database using Prisma Migrate.
Give the feature a try and let us know what you think in this issue.
migrate diff using exit codePrisma version 3.11.0 includes a new --exit-code flag to the migrate diff command to detect the state of a diff in several ways.
You can use the flag as follows:
npx prisma migrate diff --preview-feature \
--exit-code \
--from-[...] \
--to-[...]
Here's a list of the default and changed behavior of the error codes:
## Default behavior of exit codes
0: Returned when the diff is empty or non-empty
1: Returned on error
## Changed behavior when --exit-code is used
0: Returned when the diff is empty
1: Returned on error
2: Returned when the diff is non-empty
Read about it in the reference documentation.
db push with empty schema.prisma: Error: TypeError: Cannot read properties of undefined (reading 'url')db execute cannot resolve SQLite file path from schemaPANIC: called Option::unwrap() on a NoneOption::unwrap() on a None valuetlsCAFile failsOption::unwrap() on a None value in query-engine/connectors/mongodb-query-connector/src/root_queries/write.rs:301:74contains string filter not working with mongoDBOption::unwrap() on a None value in query-engine\connectors\mongodb-query-connector\src\root_queries\read.rs:112:74@map panics on 3.10.0'then' in PrimsaPromise returns falsemap does not exist for M:N in MongoDBequals read operationis read operationisNot read operationisEmpty read operationevery read operationsome read operationnone read operationHuge thanks to @hayes, @maddhruv, @jasimon 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, March 17 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
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