title: Mongoose/MongoDB throwing duplicate key error on save?
body: <p>According to <a href="http://docs.mongodb.org/manual/reference/method/db.collection.save/" rel="noreferrer">MongoDB's documentation</a> a call to <code>save</code> will create a new document, or update an existing document if <code>_id</code> is provided.  Mongoose's documentation is <a href="http://mongoosejs.com/docs/api.html#model_Model-save" rel="noreferrer">less detailed</a> and does not go into whether it will insert or update.</p>
  
  <p>I am attempting to use Mongoose's <code>save</code> function to update a document, but I keep getting the error:</p>
  
  <blockquote>
    <p>{"error":{"name":"MongoError","code":11000,"err":"insertDocument ::
    caused by :: 11000 E11000 duplicate key error index:
    staging.participants.$_id _  dup key: { :
    ObjectId('5515a34ed65073ec234b5c5f') }"}}</p>
  </blockquote>
  
  <p>Does Mongoose's <code>save</code> function perform an upsert like MongoDB's <code>save</code> function or is it just performing an insert?</p>