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)

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1b3c29d-4087b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1b3c29d-4087b.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?