title: Mongo nested object array update
body: <p>I'm trying to update a value in a document and i haven't seen an example that shows me what i need to do.  Here is how my document looks:</p>
  
  <pre><code>{
      "_id" : ObjectId("5429e8a53150d03d541c7a53"),
      "foo" : {
          "bar" : {
              "0" : {
                  "email" : {
                      "0" : "bob@aol.com"
                  }
              }
          }
      }
  }
  </code></pre>
  
  <p>This is of course not my real object but represents the structure.  how do i update bob@aol.com to be whatever@whocares.net ?</p>
  
  <p>Also how would i remove this same element?</p>
  
  <p>Also (for bunus points) how would i update this using the php Mongo class?</p>