Alex Ruheni
3.12.0
prisma rainbow
mongodb*MongoDB is now Generally Available*
Today we’re proud to announce that MongoDB is now stable and production-ready. After upgrading to 3.12.0
, you can remove the MongoDB preview flag in your schema:
datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
- previewFeatures = ["mongoDb"]
}
Here are some of the feature highlights we developed over this period:
• Expressive and type-safe operations for querying MongoDB embedded documents
• Increased likelihood of referential integrity in your database
• Thorough introspection support for using Prisma with existing MongoDB databases
• Declarative index management right from your Prisma Schema with db push
• Powerful raw query APIs to help you incrementally migrate to Prisma
You can learn about these features in the release blog post and more in our freshly brewed MongoDB Guide. For newcomers to Prisma with MongoDB, we recommend checking out our Getting Started Guide.
To celebrate this milestone, we invite you to join Prisma’s MongoDB Launch Week starting on April 25th. Enjoy a jam-packed week of exclusive workshops with plenty of opportunities to win free MongoDB Atlas credits and swag. It’s free to sign-up and available anywhere you have an internet connection.
🚨 Please be aware that we made a few breaking changes to tie up loose ends before General Availability:
• `@db.Array` replaced with `@db.ObjectId`
• Removed Decimal support
We made some changes in the `3.11.1` patch release, in case you missed it.
🗄️ Index support on composite type fields
We also added support for adding indexes on embedded document fields in MongoDB. You can now define a normal, unique, or full-text index in your schema.
type Address {
street String
number Int
}
model User {
id Int @id
email String
address Address
@@index([email, address.number]) /// normal index
@@unique([email, address.street]) /// unique index
@@fulltext([email, address.street]) /// full-text index
}
Note: Prisma Client does not yet fully support this feature and will be rolled out in a future release🔌 Improved connection pooling resiliency In
3.12.0
, we busted a ghost that has been bugging teams since the early days of the Prisma ORM. Under certain amounts of load, some people reported that the connection pool would sometimes drop connections or deadlock and not recover.
After many sightings and much head-scratching, we could finally reproduce the issue. This allowed us to narrow down the problem to one of our dependencies and fix the problem.
To read the nitty-gritty details of the problem and our solution, check out this issue.
📚 Learn more in the release notes
For more info and links to documentation, you can read the release notes.
🌟 Help us spread the word about Prisma. 🌟
To help spread the word about Prisma, we’d very much appreciate it if you would star the repo, 🌟 And if you’re excited about the features in this week’s release, then help us and share your excitement on Twitter.
📰 Join us on Thursday for the “What’s new in Prisma” livestream
This week, @nikolasburk, @Sabin Adams, and I will discuss the latest release and other news from the Prisma ecosystem in a this Thursday at 5 pm Berlin | 8 am San Francisco.