title: Add property to mongoose document pre lowercase validation
body: <p>I want a user object to maintain case sensitivity for display purposes, but be lowercased for unique-ness purposes. My first thought is to add a <code>usernameDisplay</code> property to the schema and try a pre-save hook:</p>
  
  <pre><code>var userSchema = new Schema({
      username: {
          type: String,
          required: true,
          unique: true,
          lowercase: true
      },
      usernameDisplay: String,
      password: {
          type: String,
          required: true
      }
  });
  
  userSchema.pre("save", function (next) {
      this.usernameDisplay = this.username;
      next();
  });
  </code></pre>
  
  <p>But this doesn't seem to work. The <code>username</code> and <code>usernameDisplay</code> properties are both saved as lowercase usernames.</p>
  
  <p>I think the following would work: remove the <code>lowercase</code> validation in the schema and do this:</p>
  
  <pre><code>userSchema.pre("save", function (next) {
      this.userDisplayName = this.username;
      this.username = this.username.toLowerCase();
      next();
  });
  </code></pre>
  
  <p>but now I'm curious about how Mongoose does the lowercase validation/alteration to the incoming data.</p>
  
  <p>Please let me know if my question isn't clear and I can try to update it for clarity.</p>