title: Updating a unique value into an array not working with addToSet
body: <p>So here's my schema for Mongoose. </p>
  
  <pre><code>  var userSchema = new Schema({
  
  id : {
  
  type: String,
  unique: true,
  required: true
  
  },
  FriendIds:  [
  
  {
  
  type: String,
  unique: true 
  
  }
  
  
  ]
  
  });
  </code></pre>
  
  <p>FriendsIds is an array of type String. I want to update values into that array although I do not want to duplicate them. Before you down-vote this, 
  yes I have checked other questions on stack and none of them worked for me. I even copied this code straight from mongo documentation and it did not work. </p>
  
  <pre><code>User.update({id: req.params.ID}, {$addToSet: {FriendIds: [req.body.friendId]}})    . 
  </code></pre>
  
  <p>I'am positive that req.params.ID gives a proper value that is already saved, and that req.body.friendId is a String. However, I cannot get that String to append to the FriendIds. Thank you. </p>
  
  <p>Edit: One thing i forgot to mention is that User = mongoose.model('friend', userSchema); </p>