DEV Community 👩‍💻👨‍💻

Amit Chambial
Amit Chambial

Posted on

How to perform migrations in Mongodb

Hey everyone

I am working on a side project where I am using mongodb nodejs nextjs.

I am performing some schema update and my code is breaking up as the objects created before schema update have not been updated or not have a particular field.
Can somebody provide me the best way to perform dB migrations in mongodb using javascript.

Top comments (2)

Collapse
pranupranav97 profile image
Pranu Pranav • Edited on

Hi this is one of the required skillset, if you are a full stack developer or a developer working on a stack that contains mongodb. I choose migrate-mongo package, you can install it using npm via command npm i migrate-mongo. It is simple.
Perform the migrations in data access layer of your application.

Find what you were looking for? Sign up so you can:

 
🌚 Enable dark mode
🔠 Change your default font
📚 Adjust your experience level to see more relevant content