title: Mongoose optional minlength validator?
body: <p>How can I have an optional <code>string</code> field type with a <code>minlength</code>.  The docs <a href="http://mongoosejs.com/docs/api.html#schema_string_SchemaString-minlength" rel="nofollow">(linked here)</a> do not go into detail on this?  I have been trying:</p>
  
  <pre><code>var schema = mongoose.Schema({
      name: { type: String, required: true, maxlength: 255 },
      nickname: { type: String, minlength: 4, maxlength: 255 }
  });
  </code></pre>
  
  <p>Every variation I try returns some type of error.</p>
  
  <p>My goal is to evaluate the <code>minlength</code> and <code>maxlength</code> <strong>only if</strong> the value has been supplied.</p>