Sample to rename multiple fields at the same time in MongoDB:
db.yourCollectionName.updateMany( {}, { $rename: { "field1OldName": "field1NewName", "field1OldName": "field2NewName" } } );
Sample to rename multiple fields at the same time in MongoDB:
db.yourCollectionName.updateMany( {}, { $rename: { "field1OldName": "field1NewName", "field1OldName": "field2NewName" } } );