Repository navigation
MongoDB support for Prisma 2+ #1277
Description
Activity
Hey @gotenxds, thanks a lot for opening this issue! While we can't commit to a concrete timeline, our current plans are to tackle MongoDB support some time this year. Right now we're focussed on making Prisma stable and resilient for relational DBs, we'll post updates on MongoDB support once the initial, production-ready releases of Prisma 2 are done.
Note that we'll keep this issue open as a tracking issue for MongoDB support (I also took the liberty of updating the title to make this a bit more clear).
Reacted by Simon Sturmer, Minor Arrieta Rojas, Sander Visser, Guillermo Enrique Bernal Moreira, Nicolas Sturm, hugofqt, Leo Hui, Nicklas 'Nick' Reincke, Teagan Atwater, kiran-vlinder and 42 moreReacted by Lihour, Bill Pliske, Areyan and Rizki RifandaniReacted by saurabhlabde, Bill Pliske and Rizki Rifandani- addedkind/featureA request for a new feature.A request for a new feature.and removed
on Jan 8, 2020 @nikolasburk as development of prisma 1 seems to have completly staled, we are now in a bad position. We want to continue to use mongodb with prisma, in particular because embedded objects make a lot of sense for the kind of content we are dealing with.
But on the other hand there are a lot of flaws and bugs with prisma1 and embedded objects. It would probably a good idea to at least take a look at these issues (and maybe even fix that on version 1), so that they won't occur on prisma2.
Reacted by Aske Ertmann, Gustavo, Hitabis Engineering, Muhammad Rafiul Ilmi Syarifudin, Nicklas 'Nick' Reincke, Arsham Khoee and Rizki RifandaniReacted by Daniel Norman, Nathan Reuter Godinho, Nicklas 'Nick' Reincke and Rizki RifandaniHey @macrozone, I'm really sorry that we're currently unable to fix your situation. As I mentioned, unfortunately we can't commit to a timeline but we're already collaborating with the folks from MongoDB and they're in the process of building a MongoDB Rust driver which is required as foundation for our MongoDB connector. If the current limitations of Prisma 1 are a blocker for you and you can't afford to wait until Prisma 2's MongoDB connector is ready, it might be that you have to migrate off of Prisma for now unfortunately. I assume migrating the data to a relational database is not an option for you?
Hey @macrozone, I'm really sorry that we're currently unable to fix your situation. As I mentioned, unfortunately we can't commit to a timeline but we're already collaborating with the folks from MongoDB and they're in the process of building a MongoDB Rust driver which is required as foundation for our MongoDB connector. If the current limitations of Prisma 1 are a blocker for you and you can't afford to wait until Prisma 2's MongoDB connector is ready, it might be that you have to migrate off of Prisma for now unfortunately. I assume migrating the data to a relational database is not an option for you?
yes, we are evaluating to use postgres instead of mongodb. Unfortunatly, embed types are still not implemented in prisma2: #1277 (comment)
@nikolasburk just wanted to tell you that we now using prisma2 with postgres (from google cloud) and we love it so far! (in particular with nexus) I hope you guys can keep the momentum!
Reacted by Jan Piotrowski, Tim Suchanek, Johannes Schickling, Nikolas, Daniel Norman, Orlando Del Aguila, Luận Trần, Nicklas 'Nick' Reincke, Harshit Pant, Guillermo Enrique Bernal Moreira and 9 moreReacted by Nikolas, Orlando Del Aguila, Nicklas 'Nick' Reincke, Guillermo Enrique Bernal Moreira, Vieko Franetovic, Javanie Campbell, Ali Asqar Aghchelou, Arnaud Méhat, Huseyn Guliyev, Mahmoud Abdelwahab and 2 moreGetting this working with Mongo would be a god send. Mongoose + TypeScript (using Typegoose) is still painful. Mongoose just has some inherent design principles that make type safe usage very tedious and manual. +1 x1000
Reacted by Gustavo, Hitabis Engineering, Alexander Buzin 🇺🇦, Harshit Pant, Guillaume Humbert, xdave, Jiri Kolarik, Tiago Boeing, Nathan Reuter Godinho, Lucas Willems and 20 moreI'm looking forward to seeing support for MongoDB, that would be a huge addition to Prisma.
Reacted by Gustavo, Guillaume Humbert, Louis Lombardo, xdave, Jiri Kolarik, Muhammad Rafiul Ilmi Syarifudin, Nicklas 'Nick' Reincke, a1095114983, Pablo Díaz, Trésor Muco and 20 moreCan't wait to see what you guys come up with for MongoDB. NoSQL DBs are becomming more common for early companies and startups to use, so if your tooling could build on top of MongoDB there would be a massive amount of interest from new companies to use Prisma!
Reacted by Mallikarjuna, Yariv Gilad, Victor Shukuru, Matúš Bielik, Truong Fiu, Bill Pliske and Rizki Rifandani99 remaining items
MongoDB support is now in Preview as of v2.27.0
Docs are looking good as well 😎.
Reacted by Can Vural, Milo, Matt Mueller, Diyorbek Sadullaev, Sylvain Dumont, Hayder, Anatole, Michaël De Boey, Hansel, Hassan Corrigan and 17 moreReacted by Nicklas 'Nick' Reincke, Jonah Snider, Boaris, Milo, Matt Mueller, Diyorbek Sadullaev, Sylvain Dumont, Hayder, Anatole, Michaël De Boey and 9 moreReacted by Diyorbek Sadullaev, Hayder, Anatole, Hansel, Vitaly Tkachenko, phifa, Advaiya Lad, codsane, Gheorghe Avram, Harshit Pant and 3 moreReacted by Nicklas 'Nick' Reincke, Milo, Matt Mueller, Diyorbek Sadullaev, Sylvain Dumont, Anatole, Michaël De Boey, Hansel, Asım Tahir, phifa and 7 more- changed the title
[-]MongoDB support for Prisma 2[/-][+]MongoDB support for Prisma 2+[/+]on Sep 23, 2021 Will the preview be supporting the new Serverless MongoDB (v5.0.3+)?
https://www.mongodb.com/cloud/atlas/serverlessReacted by Ezeikel@AliAlQassab I just created an issue for your request: #9659
Reacted by Ali AlQassab, Ezeikel and AnatoleMay i know is it support upgrade from prisma1 to prisma3 with mongoDB?
May i know is it support upgrade from prisma1 to prisma3 with mongoDB?
We have seen good success in first testing to introspect a Prisma 1 MongoDB database, and then use the resulting Prisma Schema to create a current Prisma Client. This of course requires you to update your application to use the new Prisma instead of Prisma 1.
Hey all, I just wanted to share that Embedded Document support for MongoDB is now in Preview!
It's easy to get started. First, install the latest Prisma (3.10.0) and add the
mongoDbpreview feature flag:datasource db { provider = "mongodb" url = env("DATABASE_URL") } generator client { provider = "prisma-client-js" previewFeatures = ["mongoDb"] }
Then you'll have a new
typekeyword in your Prisma Schema (or will get schemas withtypefor your existing MongoDB databases that use Embedded Documents when runningprisma db pull), for example:model Order { id String @id @default(auto()) @map("_id") @db.ObjectId product Product @relation(fields: [productId], references: [id]) color Color size Size shippingAddress Address billingAddress Address? productId String @db.ObjectId } // New composite type! type Address { street String city String zip String }
Once you run
prisma generate, you'll have a new type-safe API for working with these types.For example, here's how you'd create a new Order:
const order = await prisma.order.create({ data: { // Normal relation product: { connect: { id: 'some-object-id' } }, color: 'Red', size: 'Large', // Composite type shippingAddress: { street: '1084 Candycane Lane', city: 'Silverlake', zip: '84323', }, }, })
This is just the tip of the iceberg. Dive deeper in our documentation.
If you have any feedback for us, I'd love to jump on a call with you.
We're actively working towards getting MongoDB production ready, so now's the time to give this a try and share your thoughts!
Reacted by Ali Yusuf, Matko Bulić, Sylvain Dumont, Janek Thomaschewski, zernie, Gheorghe Avram, Harshit Pant, alfieqashwa and Alejandro MoralesReacted by Ali Yusuf, Matko Bulić, Sylvain Dumont, Asım Tahir, zernie, Gheorghe Avram, Harshit Pant, Jiri Kolarik and Alejandro MoralesReacted by Dinil Fernando, Gheorghe Avram, Harshit Pant and Alejandro MoralesAs MongoDB support continues to work its way towards GA (🚀🥳🕺), I wanted to also drop a link to a write up on the Status of RedwoodJS and MongoDB as of Early 2022.
There are a few details to still iron out to reach complete feature parity with the SQL alternatives, but we've got a lot of the pieces in place and it's more than ready for anyone interested in testing it out and providing early feedback.
Reacted by Jan PiotrowskiThis is in GA since 3.12 🎉
Reacted by Anatole, Gheorghe Avram, James Bream and rostikowb
Our team is considering working with Prisma, but as Prisma 1 seems to go out of scope and prisma 2 not mongo ready yet would love to know when is support expected to be released? a week? a month ? 2021 ?