title: Save additional field using Mongoose Hook
body: <p>I would like to save the lower cased version of my <code>name</code> field so that I can perform efficient case insensitive searches on the name field. Since I am working with an external API I also store the unmodified response object into my database.</p>
  
  <p><strong>My question:</strong></p>
  
  <p>How can I save the lower cased version of my <code>name</code> field without modifying the API response (I still would like to pass the response object to my model when saving new documents).</p>
  
  <p><strong>Dummy model:</strong></p>
  
  <pre><code>const userSchema = mongoose.Schema({
    name: {
      type: String,
      required: true,
      index: true,
    },
    name_lowercased: {
      type: String,
      required: true,
      index: true,
    }
  })
  </code></pre>
  
  <p>I assume it's possible using the <code>pre('save')</code> or <code>post('save')</code> hooks, but I have no idea how I could modify the to be saved document in the hooks.</p>