title: Adding values at front with $addToSet modifier
body: <p>I am trying to run an update query on mongo, which will add few values in an existing array property. </p>
  
  <p>My goal is to add the elements at the beginning of the array, instead of at the end, which is happening by default. Here is the code I am using:</p>
  
  <pre><code>db.collection("Project").update({'_id': group.project}, {$addToSet: {'endpointOrder': {$each: group.endpointOrder, $position: 0}}}, {multi: true})
  </code></pre>
  
  <p>As you can see above, if I just change the 'addToSet' to use 'push' modifier, then works fine, but that will keep the duplicates, which can't be. So, my assumption is that, $position is only supported for '$push' , not for '$addToSet'.</p>
  
  <p>Any idea/suggestions about how can I achieve that? Thanks.</p>