title: Is it possible to update an already open document in mongodb
body: <p>In JS, Is there a better way of doing the following:</p>
  
  <p>I'm finding a user, and then checking password, then I wish to update the same users' document.</p>
  
  <p>Can I leverage the already open document (var doc) for updating? Or do as the code below does and re-search for name:name when updating.</p>
  
  <pre><code>user_collection.findOne({ name:name }, function(err, doc) {
      if(err) 
          throw err;
      if(doc) {
          // verify doc.password etc
          user_collection.update({ name:name }, {$set: { last_joined:last_joined }}, { upsert:true }, function(err, doc) {
              if(err) {  
                  // log error 
              }
          });                 
      }
  });
  </code></pre>