title: php/mongoDB: add item to inner array
body: <p>My structure looks like this:</p>
  
  <pre><code>"_id" : { "$oid" : "502ac2858386b3f419000002"} ,
  "eventName" : "eventA" ,
  "eventStreamName" : "eventA-0001" ,
  "encoders" : [ 
      { 
      "encoderName" : "enc-201" ,
      "streams" : [ 
          { "language" : "eng" , "format" : "flash" , "priority" : "primary"} ,
          { "language" : "spa" , "format" : "flash" , "priority" : "primary"} ,
          { "language" : "fra" , "format" : "flash" , "priority" : "primary"}
          ]
      } ,
      { 
      "encoderName" : "enc-202" ,
      "streams" : [ 
          { "language" : "eng" , "format" : "flash" , "priority" : "primary"} ,
          { "language" : "spa" , "format" : "flash" , "priority" : "primary"}   // i'd like to add stream here
          ]
      } 
  ]
  </code></pre>
  
  <p>I would like to push an item to the streams array where encoderName = 'enc-202' and eventName = 'eventA'</p>
  
  <p>Here's what I've tried</p>
  
  <pre><code>    $this-&gt;liveEvents = $db-&gt;selectCollection("liveEvents");
      $newStream = array("language" =&gt; "ger",
              "format" =&gt; "flash",
              "priority" =&gt; "primary");
  
      $filter = array("eventName" =&gt; "eventA",
                      "encoders.encoderName" =&gt; "enc-202");
      $update = array('$push'=&gt;array('encoders.streams'=&gt;$newStream));
  
      $this-&gt;liveEvents-&gt;update($filter,$update);
  </code></pre>
  
  <p>but its not working.  I'm not sure if I can add 2 items to my $filter, and my $update may be off too.</p>
  
  <p>New to mongodb. Any help would be great. Thanks!</p>