title: How to set the value of a default attribute of a Mongoose schema based on a condition
body: <p>I have this mongoose schema:</p>
  
  <pre><code>var UserSchema = new Schema({
      "name":String, 
      "gender":String,
  });
  </code></pre>
  
  <p>I want to add another field named image. This image will have a default value if gender is <code>male</code> and it will have another default value if gender is <code>female</code>. I found that the default value can be set with:</p>
  
  <pre><code>image: { type: ObjectId, default: "" }
  </code></pre>
  
  <p>But I do not find how can I set it with condition.</p>