New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
MongoDB support for Prisma 2+ #1277
Comments
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). |
@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. |
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! |
Getting 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 |
I'm looking forward to seeing support for MongoDB, that would be a huge addition to Prisma. |
Can'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! |
I have a new project we are kicking off at work and I was really hoping I could build a POC for Prismic 2 for it over easter. Unfortunately, we are kinda tightly bound with MongoDB, and it would be a difficult sell to the higher-ups to go a different direction. I really hope you guys can get this one nailed down. |
Really looking forward to Mongo support, hope it comes really soon, will definitely be using this with Mongo in the future. |
Out of curiosity, would it be possible and sensible to implement our own database connector for MongoDB or BigTable for example? Or would it just be easier to implement a wrapper at the API level in resolvers? |
Hello! I'm one of the developers of the MongoDB Rust driver, so I just wanted to pop in and give an update about the status of the driver. We just recently completed our rewrite of the driver internals to be async, and we're now finishing up the last few features we need to be able to release our first beta of the driver, which should have everything that's needed for adding MongoDB support to Prisma. Thanks for your patience while waiting for us to finish up our work on the driver; we hope to have something ready soon! |
Hello again! Just following up to let every know we released the first beta for the MongoDB Rust driver, v0.10.0, just moments ago, so async support is fully available for the driver. |
@saghm That is Wonderfull news! Looking forward to using it. |
I'm so excited to use Prisma 2 with Mongodb |
@saghm How to use it? Does it come directly with Prisma? |
Hey @lcswillems and everybody else waiting for MongoDB Support in Prisma. @saghm is on the engineering team at Mongo who did an excellent job at implementing a MongoDB driver for the Rust programming language, which is used in the Prisma Query Engine. Based on this work, we are now working on creating a MongoDB connector for Prisma. I can't give you a timeline for MongoDB support, but we definitely appreciate the excitement in the community as evidenced by reactions in this thread. I want to thank the MongoDB team for their excellent collaboration, and I look forward to sharing the result of this work with the wider Prisma community soon. |
Reactions, hell yes, and they are all positive. Super can't wait for this. Will be doing a POC for our company (currently too many API's and crap all over the place) and we are all in on MongoDB. This is going to be fun |
Is there any way we could contribute? Love to help! |
Am really looking forward to see prisma2 support MongoDB. Can't wait to migrate from prisma1 |
Any news about the mongo driver? |
I would help too if I can. |
trying to use this in keystonejs/keystone#5480; seems promising but have some caveat. looking forward for preview release ---- edit --- |
Prisma + MongoDB === To the sky and beyond! |
I've done a little write up for getting setup with Prisma and MongoDB on Atlas. Lots of caveats from Matt of course, but I was able to get spun up and writing to the database seamlessly. We also have connected the RedwoodJS example blog to a Mongo database and David said it took him under 30 minutes to get it working. A time for double rockets if there ever was one |
MongoDB support is now in Preview as of v2.27.0Docs are looking good as well |
Will the preview be supporting the new Serverless MongoDB (v5.0.3+)? |
@AliAlQassab I just created an issue for your request: #9659 |
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 datasource db {
provider = "mongodb"
url = env("DATABASE_URL")
}
generator client {
provider = "prisma-client-js"
previewFeatures = ["mongoDb"]
} Then you'll have a new 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 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! |
As MongoDB support continues to work its way towards GA ( 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. |
This is in GA since 3.12 |
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 ?
The text was updated successfully, but these errors were encountered: