title: Updating a nested Array in using UpdateOne()
body: <p>I'm having an issue updating a nested Array in a document. Reading around the topic i've come across various method, one that i've tweaked below, however nothing seems to work for me!</p>
  <p>I'm trying to update the field <code>systemUpdate_DT</code> which is in a parent Array called <code>List</code> and a child array called <code>customData</code>. I'm referring to the object in the child array using the key <code>_id</code> of the parent array and key <code>field_id</code> in the child array.</p>
  <p>How do I update the <code>systemUpdate_DT</code> of the respective object?</p>
  <p>Live Example: <a href="https://mongoplayground.net/p/453OFPOQqBp" rel="nofollow noreferrer">https://mongoplayground.net/p/453OFPOQqBp</a></p>
  <p>A document in the collection looks like:</p>
  <pre><code>[
    {
      &quot;_id&quot;: &quot;6032a5ad80443334a35f2232&quot;,
      &quot;List&quot;: [
        {
          &quot;_id&quot;: &quot;6032a5af80443334a35f2234&quot;,
          &quot;customData&quot;: [
            {
              &quot;_id&quot;: &quot;6032a5bc80443334a35f223c&quot;,
              &quot;systemUpdate_DT&quot;: null,
              &quot;field_id&quot;: &quot;6032a5bc80443334a35f223b&quot;
            },
            {
              &quot;_id&quot;: &quot;6032a5c280443334a35f223e&quot;,
              &quot;systemUpdate_DT&quot;: null,
              &quot;field_id&quot;: &quot;6032a5c280443334a35f223d&quot;
            }
          ]
        },
        {
          &quot;_id&quot;: &quot;6032a5b080443334a35f2236&quot;,
          &quot;customData&quot;: [
            {
              &quot;_id&quot;: &quot;6032a5bc80443334a35f223c&quot;,
              &quot;systemUpdate_DT&quot;: null,
              &quot;field_id&quot;: &quot;6032a5bc80443334a35f223b&quot;
            },
            {
              &quot;_id&quot;: &quot;6032a5c280443334a35f223e&quot;,
              &quot;systemUpdate_DT&quot;: null,
              &quot;field_id&quot;: &quot;6032a5c280443334a35f223d&quot;
            }
          ]
        }
      ]
    }
  ] 
  </code></pre>
  <p>My Update Query looks like:</p>
  <pre><code>db.collection.updateOne({
          {
        &quot;List._id&quot;: mongodb.ObjectId(&quot;6032a5af80443334a35f2234&quot;),
        &quot;List.customData.field_id&quot;: mongodb.ObjectId(&quot;6032a5bc80443334a35f223b&quot;)
      },
      {
        $set: {
          &quot;List.$.customData.systemUpdate_DT&quot;: 'updatedDTTM'
      }
  })
  </code></pre>