Change a field name in-place.
Section: Field update operators
Rename a field
javascript
javascript
db.users.updateMany({}, { $rename: { fullname: "full_name" } })Explanation
Useful during schema evolution.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Field update operators