title: Firebase PHP update specific Array index in Field
body: <p>I don't how how or if its is possible to udpate an Array value with a custom index.
  My code is in PHP but i can swith to JS if it is nessesary</p>
  <p>Here my challange:
  I have an itemarry (with many rows and different kinds) which includes a futher array.
  and i want to change a custom row of the itmes array</p>
  <p>for e.g. I want to change the status and the userid of the arrayindex &quot;Items[0]&quot;</p>
  <p>I'D tried it with</p>
  <pre><code>$document = $db-&gt;collection('events')-&gt;document($eventid);    
  $document-&gt;update([
          [
              'path' =&gt; 'items.0', 'value' =&gt; FieldValue::arrayUnion([[
              'status' =&gt; '1',
              'userid' =&gt; '383747493834',
              ]])
          ]
      ]);
  </code></pre>
  <p>and</p>
  <pre><code>$document-&gt;set([
          'regions' =&gt; FieldValue::arrayUnion([[
              'kind' =&gt; 'test',
              'status' =&gt; '1',
              'userid' =&gt; '383747493834',
          ]])
      ], ['merge' =&gt; true]);
  </code></pre>
  <p>but nothing work in the first example Firebase add a new Field in the document and in the second example a new row was added</p>
  <p><a href="https://i.stack.imgur.com/BCoAt.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/BCoAt.png" alt="Firebase Database" /></a></p>