Issue
- I tried to update docs matches query using Mongodb compass
- Even with
$set
(And UI showing updated docs…), Mongodb compass’s aggregation tab is not updating actual documents in collection (ref)
- This aggregation does not affect actual docs even though UI shows you updated fields
Solution
- Installed mongosh and copied rpm file to production server using scp, and then install using command
rpm -i {filename}.rpm
- run
db.collection.updateMany({query}, {$set operation})
inside mongosh
Referenced