Skip to content

MongoDB support for Prisma 2+ #1277

Description

@gotenxds

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 ?

Activity

  1. changed the title [-]mongodb support, when[/-] [+]MongoDB support for Prisma 2[/+] on Jan 8, 2020
  2. nikolasburk commented on Jan 8, 2020

    @nikolasburk
    Contributor

    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).

  3. removed their assignment
    on Jan 8, 2020
  4. macrozone commented on Feb 3, 2020

    @macrozone

    @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.

  5. nikolasburk commented on Feb 5, 2020

    @nikolasburk
    Contributor

    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?

  6. macrozone commented on Feb 8, 2020

    @macrozone

    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)

  7. macrozone commented on Mar 4, 2020

    @macrozone

    @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!

  8. duro commented on Mar 31, 2020

    @duro

    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

  9. raulingg commented on Apr 2, 2020

    @raulingg

    I'm looking forward to seeing support for MongoDB, that would be a huge addition to Prisma.

  10. kalebjdavenport commented on Apr 7, 2020

    @kalebjdavenport

    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!

  11. 99 remaining items

  12. modified the milestones: 2.24.0, 2.25.0 on Jun 2, 2021
  13. modified the milestones: 2.25.0, 2.26.0 on Jun 17, 2021
  14. ajcwebdev commented on Jul 14, 2021

    @ajcwebdev

    MongoDB support is now in Preview as of v2.27.0

    Docs are looking good as well 😎.

  15. changed the title [-]MongoDB support for Prisma 2[/-] [+]MongoDB support for Prisma 2+[/+] on Sep 23, 2021
  16. AliAlQassab commented on Oct 7, 2021

    @AliAlQassab

    Will the preview be supporting the new Serverless MongoDB (v5.0.3+)?
    https://www.mongodb.com/cloud/atlas/serverless

  17. matthewmueller commented on Oct 7, 2021

    @matthewmueller
    Contributor

    @AliAlQassab I just created an issue for your request: #9659

  18. codingfunwoody commented on Nov 22, 2021

    @codingfunwoody

    May i know is it support upgrade from prisma1 to prisma3 with mongoDB?

  19. janpio commented on Feb 14, 2022

    @janpio
    Contributor

    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.

  20. matthewmueller commented on Feb 28, 2022

    @matthewmueller
    Contributor

    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 mongoDb preview feature flag:

    datasource db {
      provider = "mongodb"
      url      = env("DATABASE_URL")
    }
    
    generator client {
      provider        = "prisma-client-js"
      previewFeatures = ["mongoDb"]
    }

    Then you'll have a new type keyword in your Prisma Schema (or will get schemas with type for your existing MongoDB databases that use Embedded Documents when running prisma 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!

  21. ajcwebdev commented on Mar 6, 2022

    @ajcwebdev

    As 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.

  22. dpetrick commented on May 18, 2022

    @dpetrick
    Contributor

    This is in GA since 3.12 🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions