title: mongoose set: toLower not working on nested properties
body: <p>I'm trying to normalize email addresses to lowercase before they are saved in the database. Setters on mongoose models are great for that and they work on simple models. However, when I try to set the toLower setter on a nested object where email is stored inside "owner" I get <code>TypeError: Cannot call method 'toLowerCase' of undefined</code></p>
  
  <p>function toLower (v) {
    return v.toLowerCase();
  }</p>
  
  <p>This crashes:</p>
  
  <pre><code>var BusinessSchema = new mongoose.Schema({
      owner: {
          email:  { type: String, required: 'Email adres mag niet leeg zijn.', set: toLower, get: toLower, index: { unique: true } },
          password: { type: String, required: 'Wachtwoord mag niet leeg zijn.' }
      }
  });
  </code></pre>
  
  <p>This works:</p>
  
  <pre><code>var UserSchema = new Schema({
    email: { type: String, set: toLower } 
  });
  </code></pre>