title: Mogoose findOneAndUpdate how to know wether object exist and if modified
body: <p>I am using <code>findOneAndUpdate</code> method of mongoose:</p>
  
  <pre><code>function update_one_record(Model, unique_constraint, new_updated_values){ 
      obj=Model.findOneAndUpdate(
          //Similarly we have findOneAndRemove
          unique_constraint, 
          {$set: new_updated_values},
          {upsert: true}, 
          function(err, raw){
              console.log(err, raw)
      })
      return obj
  }
  </code></pre>
  
  <p>I want to know:</p>
  
  <ol>
  <li>if that object existed or not</li>
  <li>if  object modified or not if not what is the errors. </li>
  </ol>