In MongoDB, I have a movie collection that has an array of languages , e.g.
languages: [0:USA, 1: German, 2: French, ...etc]
The array values are not in any particular order.
How can I now update an array value based on some specific value? Let's say I want to update all "French" and replace it with "Francais" for the entire collection. How can I do that?
db.movies.updateMany({ "languages": "French" }, { "$set": { "languages.$": "Francais" } })? Refer to the documentation