title: Mongodb update with array of items post v2.2.6
body: <p>I have an update statement that use to work in 2.2.6, but fails in 2.8.x and in 3.0.1</p>
  
  <p>In short: I have an array of items, and I want to update the one with a name of 'CreateDeliveries' and a state of 'NOT STARTED'.</p>
  
  <p>The problem is this just updates the first element in the array, not the one that matches (i.e. the last element).</p>
  
  <p>In 2.2.6 this worked fine.</p>
  
  <p>In 2.8.x this updates the first element (incorrect)</p>
  
  <p>In 3.0.1 this updates zero rows.</p>
  
  <p>This is my test document..</p>
  
  <pre><code>    {
      "_id" : ObjectId("5510070f7baa49e5db605c89"),
      "cacheIds" : [ 
          "456"
      ],
      "expectedSteps" : [ 
          {
              "name" : "CacheBuildProcessor",
              "state" : "ENDED"
          }, 
          {
              "name" : "CacheProcessors",
              "state" : "NOT STARTED"
          }, 
          {
              "name" : "ProductSequential",
              "state" : "NOT STARTED"
          }, 
          {
              "name" : "PriceSequential",
              "state" : "NOT STARTED"
          }, 
          {
              "name" : "Data to CSV",
              "state" : "NOT STARTED"
          }, 
          {
              "name" : "CreateDeliveries",
              "state" : "NOT STARTED"
          }
      ]
  }
  </code></pre>
  
  <p>note: cacheIds is also an array, this might be affecting it.</p>
  
  <pre><code>db.getCollection('TEST').update(
  {
  "cacheIds" : "456" , 
  "expectedSteps" : { 
  "$elemMatch" :
   { "name" : "CreateDeliveries" , "state" : "NOT STARTED"}
   }
  },
  {
     $set: {"expectedSteps.$.state" : "ENDED"}
  }
  );
  </code></pre>
  
  <p>Now I've tried to use a projection to just return the section of the array I care about, and so just get it to update that section, but that doesn't seem to be a valid query/update command (it is a valid query).</p>
  
  <p>Has anyone got any ideas?</p>