mongodb rename field code example
Example 1: mongodb change key name
db.students.updateMany( {}, { $rename: { "nmae": "name" } } )
Example 2: mongodb rename property
db.getCollection('posts').update({}, {$rename: { 'comments': 'texts'}} , {multi: true});