Skip to content
This repository has been archived by the owner on Aug 26, 2022. It is now read-only.

MongoDB: create a doc or cookbook #840

Open
thedavidprice opened this issue Oct 14, 2021 · 11 comments
Open

MongoDB: create a doc or cookbook #840

thedavidprice opened this issue Oct 14, 2021 · 11 comments

Comments

@thedavidprice
Copy link
Contributor

Prisma supports MongoDB. And in a simple POC I was able to easily migrate the Tutorial blog project from Postgres to Mongo with very little changes required.

  • Generators work with MongoDB 馃殌
  • What will change with deployment? (I.e. no longer a need for prisma migrations, correct?)
  • ?
@ajcwebdev
Copy link
Collaborator

ajcwebdev commented Oct 14, 2021

I don't have much extra bandwidth right now to take on more projects, but I've done a decent amount of work on this over the last year so happy to help out and provide notes or guidance if anyone wants to take this on.

Relevant Links

TODOS

  • Docs like these for using Mongo locally instead of Postgres
  • Unit tests and mocks/scenarios, check testing the database section of docs

@barakcodes
Copy link

@ajcwebdev Happy to work with you on this. I've had some experience with Mongo.

@ajcwebdev
Copy link
Collaborator

@barakcodes that's awesome to hear!

Prisma has done a fantastic job with their MongoDB docs so we should also be heavily referencing those and making sure we stay up to date with the current capabilities. For example, Prisma v3.2 added Preview support for introspection.

Other upcoming features

Prisma Videos

For a quick and easy win I'd check out the video Prisma created for installing Mongo locally and create a doc based on that.

@barakcodes
Copy link

Thanks! A pretty detailed guide, I'll get hacking on this weekend.

@barakcodes
Copy link

@ajcwebdev Started on this, it seems the only way that I could find to get Mongo to work with serverless is using Mongo Atlas. Seem to be some limitations including migrations in comparison, I'm thinking I should specifically point these out in the docs. Maybe like a little section at the end. What do you think?

@ajcwebdev
Copy link
Collaborator

Yeah definitely, there's an open issue right now about migration support that you can link to, so Prisma is aware and is working on support.

@barakcodes
Copy link

Yeah definitely, there's an open issue right now about migration support that you can link to, so Prisma is aware and is working on support.

Thanks! @ajcwebdev I'll get on with it, then we can have a draft PR, then probably move to the production guide then finish with the testing section. How does that sound?

@ajcwebdev
Copy link
Collaborator

Yeah that sounds great, feel free to provide any pieces as they're ready to go and I will keep an eye out and provide notes 馃憤!

@ajcwebdev
Copy link
Collaborator

Word from the Prisma team is that migrations will not be supported in the near future, but you can use db push as a workaround for now.

@ajcwebdev
Copy link
Collaborator

ajcwebdev commented Mar 6, 2022

Quick update on this front, I've got a guide now on Getting Started with MongoDB on Railway. I'm too much of a MongoDB noob to know why this is the case, but there's some important differences in what connection string you need to give the Prisma schema.

Atlas Version

Append connection string with ?retryWrites=true&w=majority.

mongodb+srv://ajcwebdev:<PASSWORD>@posts.5mngs.mongodb.net/myFirstDatabase?retryWrites=true&w=majority

Railway Version

Append connection string with ?authSource=admin.

mongodb://mongo:<PASSWORD>@containers-us-west-1.railway.app:6852/test?authSource=admin

@thedavidprice and @dthyresson, given the current options what are your opinions on how to build out the cookbook in terms of the actual database deployment step? Should it include instructions for:

A. Only Atlas
B. Only Railway
C. Separate sections with instructions for each

@ajcwebdev
Copy link
Collaborator

MongoDB is now Generally Available as of Prisma v3.12.0 馃コ 馃帀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants