How does MongoDB do migration? like MySQL does?

when using MySQL, such as connecting to MySQL, with Django, a new field is added to model. As long as you do migration, on the command line, this field will be added to all previous records, but how to do it in MongoDB? Nodejs as a backend, does it have this function?

does it mean to open MongoDB directly and then command line update? Is there a migration tool like Django?

Mar.30,2021

MongoDB is a non-relational database, and there is no concept of columns. It means you don't have to add a new blank column to every document, yes or no, and it doesn't affect your use.


when deploying, execute the mongo command and add the field command: db.yourtable.update ({}, {$set: {addField: ""}}, false,true)

Menu