title: Updating documents using nested JSON or dotted keys
body: <p>Suppose I have a doc structure like this:</p>
  
  <pre><code>thing: {
    name: {
      first: "John",
      last: "Doe"
    }
  }
  </code></pre>
  
  <p>say I want to update the last name only. Which command do I send to update?</p>
  
  <pre><code>$set: {
    name: {
      first: "Connor"
    }
  }
  </code></pre>
  
  <p>or</p>
  
  <pre><code>$set: {
    "name.first": "Connor"
  }
  </code></pre>
  
  <p>Is there a difference? Or a preference? I much prefer the first since it resembles the actual document, but mongodb documentation uses the second method. </p>