title: MongoDB - how do I update a value in nested array/object?
body: <p>I have a document in my Mongo collection which has a field with the following structure:</p>
  
  <pre><code>"_id" : "F7WNvjwnFZZ7HoKSF",
  "process" : [
      {
          "process_id" : "wTGqVk5By32mpXadZ", 
          "stages" : [
              {
                  "stage_id" : "D6Huk89DGFsd29ds7",
                  "completed" : "N"
              }, 
              {
                  "stage_id" : "Msd390vekn09nvL23",
                  "completed" : "N"
              }
          ]
      }
  ]
  </code></pre>
  
  <p>I need to update the value of <code>completed</code> where the <code>stage_id</code> is equal to 'D6Huk89DGFsd29ds7' - the update query will not know which object in the stages array this value of <code>stage_id</code> will be in.</p>
  
  <p>How do I do this?</p>