title: MongoDB/PHP: update individual value of an array
body: <p>Greetings,</p>
  
  <p>I have the following mongodb object:</p>
  
  <pre><code>{
     "_id": ObjectId("4d0b9c7a8b012fe287547157"),
     "messages": {
       "0": {
         "toUname": "Eamorr3",
         "fromUname": "Eamorr2",
         "time": 1292606586,
         "id": "j7zwr2hzx14d3sucmvp5",
         "subject": "asdf",
         "message": "asdf",
         "read": 0
      }
    },
     "uname": "Eamorr3"
  }
  </code></pre>
  
  <p>How do I set "read" to 1 in PHP?</p>
  
  <p>Here's what I've tried sofar to no avail:</p>
  
  <p>update(array('uname'=>$uname),array('$set'=>array('messages'=>array('read')=>'1')));</p>
  
  <p>I'm totally stuck. Any help much appreciated.</p>
  
  <p>Many thanks in advance,</p>