title: How to update a field in an array's subdocument contained in an array's subdocument in MongoDB using C# driver?
body: <p>I have a collection of documents in MongoDB with a structure like this (there are multiple container documents, each containing <code>Sessions</code>, each session contains 1 Order, each Order contains multiple Items):</p>
  
  <pre><code>{
    "Sessions" : [{
        "ID" : "1882a092-d395-45d1-b36b-e2fa3df81b95",
        "Order" : {
          "Items" : [{
              "_id" : "a9c94a5e-10ef-433d-9c63-f4555eb7c2a7",
              "Title" : "UPDATE THIS",
            }]
        }
      }],
    "_id" : "1b640bc4-fdb4-49b1-9c60-e4c6f1bd0405"
  }
  </code></pre>
  
  <p>I would like to update <code>Title</code> of a given <code>Item</code> within an Order in a Session while knowing the <code>_id</code> of the Item (I also know ID of the Session if that helps): </p>
  
  <p>I have tried the following:</p>
  
  <pre><code>col.Update(Query.EQ("Sessions.ID", sessionID),
                  Update.Set("Sessions.$.Order.Items.Title", newTitle));
  
  col.Update(Query.EQ("Sessions.Order.Items._id", id),
                  Update.Set("Sessions.Order.Items.$.Title", newTitle));
  </code></pre>
  
  <p>Both throw an exception <code>WriteConcern detected an error 'cannot use the part (Sessions of Sessions.Order.Items.0.Status) to traverse the element ...</code>. I also tried different combinations of combined queries using <code>Query.And</code> which probably make so little sense that they are not worth posting here.</p>
  
  <p><strong>How to update field in a subdocument contained in an array of documents using the C# driver?</strong></p>
  
  <p>I realize this cannot be done with the positional operator alone (and the positional operator will not magically match inner array). </p>
  
  <p>I am looking for out of the box solutions how to accomplish this kind of update without changing the schema.</p>