title: How can I update an object inside of an array in firestore?
body: <p>I would like to update the <code>completed</code> property of an object in an array in Firestore, but I have no idea how to reach that specific element in the array. The image will show the structure.</p>
  
  <p><a href="https://i.stack.imgur.com/WwrZk.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/WwrZk.png" alt="enter image description here"></a></p>
  
  <p>I have come up this far but don't know how to choose, for example, item 1 in the array. I was thinking of using its ID (it has an id property) but don't know how to get there.</p>
  
  <pre><code>const businessRef = db.collection('approvedBusinesses').doc(businessId)
        try {
          businessRef.update({
            [`bookings.${currentDate} ????? `]: true // what to add after currentDate?
          })
  </code></pre>
  
  <p>By the way, this is how the array was created (and how other objects are pushed to it)</p>
  
  <pre><code>const bookingObj = {
        carro: 'PASSA_CARRO',
        completed: false,
        userId: userObject.uid,
      }
  
  businessRef.update({
          [`bookings.${currentDate}`]: firebase.firestore.FieldValue.arrayUnion(bookingObj),
        })
  </code></pre>