I’ve only been working with Relational Databases for many years, so it’s a little hard for me to imagine how I would go about doing this properly:
In the mflix movie example data, we will find the cast of the movie with Names as an Array.
So many movies may have the same name (but maybe its not the same guy). But what do i do when one of these people gets married?
So: How do i rename the Name of the people?
In relation-databases there would be a “cast”-Table and a “cast-movie”-Table.
And i will just update the cast-Table Name and the new Name is in all movies.
What is the exact Workflow here in Mongo?
I am sure this question has been asked several times here, but unfortunately i have not found it.
Similarly, you can use other aggregation operators attached in the documentation based on different use cases. Also note that in the update example above, the update will only be performed on a single document. You can use bulk operation if you want to change all documents containing the name to be changed.
Additionally, since you are a beginner in MongoDB, I would highly recommend you check out our University Courses to help you get started in MongoDB and make you feel more familiar with the concepts. Introduction to MongoDB MongoDB for SQL Pros
Please let us know if there are any doubts about this. Feel free to reach out for anything else as well.