title: In MongoDB how do you use $set to update a nested value/embedded document?
body: <p>In MongoDB how do you use <strong><code>$set</code></strong> to update a nested value?</p>
  
  <p>For example, consider a collection <strong>people</strong> with the following document:</p>
  
  <pre><code>{
    _id: ObjectId("5a7e395e20a31e44e0e7e284"),
    name: "foo",
    address: { street: "123", town: "bar" }
  }
  </code></pre>
  
  <p>How do I update the <code>street</code> field embedded in the <code>address</code> document from <code>"123"</code> to <code>"Main Street"</code>?</p>