title: How is findById() + save() different from update() in MongoDB
body: <p>While trying to update a MongoDB document using Mongoose, can I use a <code>findById()</code> with a <code>save()</code> in the callback, or should I stick with traditional update methods such as <code>findByIdAndModify</code>, <code>findOneAndModify</code>, <code>update()</code>, etc.? Say I want to update the <code>name</code> field of the following document (<em>please see a more elaborate example in the edit at the end, which motivated my question</em>):</p>
  
  <pre><code>{
      "_id": ObjectId("123"),
      "name": "Development"
  }
  </code></pre>
  
  <p>(Mongoose model name for the collection is <code>Category</code>)</p>
  
  <p>I could do this:</p>
  
  <pre><code>Category.update({ "_id" : "123" }, { "name" : "Software Development" }, { new: true })
  </code></pre>
  
  <p>or I could do this:</p>
  
  <pre><code>Category.findById("123", function(err, category) {
      if (err) throw err;
      category.name = "Software Development";
      category.save();
  });
  </code></pre>
  
  <p>For more elaborate examples, it feels easier to manipulate a JavaScript object that can simply be saved, as opposed to devising a relatively complex update document for the <code>.update()</code> operation. Am I missing something fundamentally important?</p>
  
  <p><strong>Edited 7/21/2016</strong> Responding to the comment from @Cameron, I think a better example is warranted:</p>
  
  <pre><code>{
      "_id": ObjectId("123"),
      "roles": [{
          "roleId": ObjectId("1234"),
          "name": "Leader"
      }, {
          "roleId": ObjectId("1235"),
          "name": "Moderator"
      }, {
          "roleId": ObjectId("1236"),
          "name": "Arbitrator"
      }]
  }
  </code></pre>
  
  <p>What I am trying to do is remove some roles as well as add some roles in the <code>roles</code> array of sub-documents in a single operation. To add role sub-documents, <code>$push</code> can be used and to remove role sub-documents, <code>$pull</code> is used. But if I did something like this:</p>
  
  <pre><code>Person.update({
      "_id": "123"
  }, {
      $pull : {
          "roles" : {
              "roleId" : {
                  $in : [ "1235", "1236" ]
              }
          }
      },
      $push : {
          "roles" : {
              $each: [{
                  "roleId" : ObjectId("1237"),
                  "name" : "Developer"
              }]
          }
      }
  }
  </code></pre>
  
  <p>When I try to execute this, I get the error <code>Cannot update 'roles' and 'roles' at the same time</code>, of course. That's when I felt it is easier to find a document, manipulate it any way I want and then save it. In that scenario, I don't know if there is really any other choice for updating the document.</p>