title: How do I add to an array in Angular Firestore?
body: <p>Im trying to add ids to my user collection for Access Control in Firestore using Angular Fire 2.</p>
  
  <pre><code> grantCompanyAccess (user, companyId) {
      try {
        const userAccess: AngularFirestoreDocument&lt;any&gt; = this.afs.doc(`users/${user.uid}`);
        return userAccess.set({companies: [companyId]});
      } catch (error) {
        console.log(error);
      }
    }
  
    removeCompanyAccess (user, companyId) {
      try {
        const userAccess: AngularFirestoreDocument&lt;any&gt; = this.afs.doc(`users/${user.uid}`);
        const userData = {
          companies:  [{companyId}]
        };
        // return userAccess.collection('companies').doc(companyId).delete();
        return userAccess.collection('companies').doc(companyId).delete();
      } catch (error) {
        console.log(error);
      }
    }
  </code></pre>
  
  <p>Currently grant method is replacing the id in the array. How do I add to the array if the value does not exist ({merge: true} does not work)  and delete from the array using the remove method.</p>