title: how to add objects to array in firestore?
body: <p>I have the below code which at first run creates a new collection with a document ID that is equal to my UID. This newly created document has an array named 'array' which contains the  cocktailInformation object. So far all works fine. </p>
  
  <pre><code>const saveData = (uid) =&gt; {
          db
              .collection('users')
              .doc(uid)
              .set({
                  array: [ cocktailInformation ]
              })
              .then(function() {
                  console.log('Document successfully written!');
              })
              .catch(function(error) {
                  console.error('Error writing document: ', error);
              });
      };
  </code></pre>
  
  <p>the issue arises when i want to add more objects to this array in this document. I checked firestore docs on how to do this and it shows the below </p>
  
  <pre><code>var washingtonRef = db.collection("cities").doc("DC");
  
  // Atomically add a new region to the "regions" array field.
  washingtonRef.update({
      regions: firebase.firestore.FieldValue.arrayUnion("greater_virginia")
  });
  
  // Atomically remove a region from the "regions" array field.
  washingtonRef.update({
      regions: firebase.firestore.FieldValue.arrayRemove("east_coast")
  });
  </code></pre>
  
  <p>but i don't know how to integrate this as the current code only updates the current object with the one i send off to firestore. Can anyone give me some tips? BTW this is a react app</p>