Auto generating migration scripts based on new Schema changes

Hello everyone, Michael here, I’ve used MongoDB for 4 years now and there’s been one thing I have always wanted to solve which is auto-generating migration scripts whenever we make new changes to our schema.

Now, while this is not a MongoDB Philosophy, I believe there are many engineers like me out there who still once in a while like to bring relational database ideals into Mongo, one of them is migrations.

We have migrations in Mongo but we do not have a way to detect schema changes and create migration scripts to run just like Typeorm provides.

So I am currently building a utility that will solve this issue and I would love to get your input, let me know what you think.

1 Like

Hi Michael – I’m the PM for our data modeling developer tools, and I’d love to chat with you! I’ll DM you a link to schedule a meeting.

1 Like

Hi Julia, thank you for responding! Happy to chat with you as well.

Why take this offline? I’d appreciate an answer to that as well

Sounds awesome, Michael!
Auto-generating Mongo migrations like TypeORM would be super helpful.
Happy to test or give feedback!

Hey @Orson_Brice, thanks for the positive feedback! Will definitely keep you in the loop and will continually update everyone on the progress of the tool.

Glad to see that I am not the only one facing the issue.

Hey everyone, I want to give an update on this, I have not had the time to really work on this because of school and work, however, I just finished my trimester today and I get August as break, so I intend to use all of August to actually build this tool.

I am also making the tool open-source so I am happy to receive any contributions you want to provide, especially with the naming of the tool, right now, it’s called mongeese.

Here is the Github Repository if you’d like to contribute.

That sounds like a solid initiative, especially for industries handling sensitive data. At Aftermath Bail Bonds where accurate client records and legal case data matter, managing schema changes securely is critical. A tool that auto-generates migration scripts would really help reduce manual errors. Looking forward to your progress!Visit here: https://www.aftermathbailbonds.com/

1 Like

Hi @Mustafa_Mahdi, thank you for your response, will definitely keep you updated!

Here’s the LinkedIn post if you want to check out the progress of the tool.

Hey everyone, happy to announce that the tool has been built and is now stable for use and also ready for testing, really great that we did this in 20 days! :tada:

LinkedIn post on this - 🚀 Day 20 of #BuildMongeese | Michael Nwuju.

Please use and test in your projects wherever you need it.

Please note the following:

  • This tool will never do anything automatically for you unless you approve it.
  • This tool never actually reads the data from your database, in order to achieve data safety, it uses MongoDB’s powerful $sample operation to sample documents and then infer characteristics like type, existence, nullability, e.t.c.
  • This tool is open-source so please feel free to contribute whenever!

In order to use the cli tool, head straight to its npm package here - Mongeese CLI

So @Mustafa_Mahdi @Orson_Brice @Michael_Niemand1, you can start using it in your projects today.

Happy to receive any reviews you have on the tool or any issues you encounter while using the tool, enjoy your day! :tada: