title: How to addToSet with date field
body: <p>I have following model in mongoose : </p>
  
  <pre><code>var RelationSchema = new Schema({
    user : {type:ObjectId, ref:'users'}
    , type : String
    , remarks : String
    , createdOn : {type:Date, default:Date.now}
  }, {_id:false});
  
  var UserRelationSchema = new Schema({
    user : {type:ObjectId, ref:'users'}
    , relations : [RelationSchema]
  });
  
  var UserRelation = mongoose.model('user_relations', UserRelationSchema);
  </code></pre>
  
  <p>Each time I run the following command with same values a new sub-document is being added to the <code>relations</code> array. If I removed <code>createdOn</code> field from the <code>RelationSchema</code> schema then it works fine.</p>
  
  <pre><code>UserRelation.update(
  {"user":&lt;ObjectId&gt;} 
  , {
      $addToSet: {
         "relations": {"user":&lt;ObjectId&gt;,"type":&lt;String&gt;}
      }
  , {upsert:true}
  });
  </code></pre>
  
  <p>My Question is :
  <strong>How can I <code>addToSet</code> with date/time fields ?</strong></p>