title: How can I rename a field for all documents in MongoDB?
body: <p>Assuming I have a collection in MongoDB with 5000 records, each containing something similar to:</p>
  
  <pre><code>{
  "occupation":"Doctor",
  "name": {
     "first":"Jimmy",
     "additional":"Smith"
  }
  </code></pre>
  
  <p>Is there an easy way to rename the field "additional" to "last" in all documents? I saw the <a href="https://docs.mongodb.org/manual/reference/operator/update/rename/">$rename</a> operator in the documentation but I'm not really clear on how to specify a subfield.</p>