title: Is there a more efficient way to remove a list of docs from firestore?
body: <p>I have this function which will run on a cron job to remove a comment from firestore 30 days after the user deletes it.</p>
  
  <pre><code>run.db.collection('sites').get()
          .then(snapshot =&gt; {
              snapshot.forEach(site =&gt; {
                  if(site.exists){
                      let query = run.db.collection('sites').doc(site.id).collection('comments');
                      query.where('removed', '&lt;', run.func.getTimeMinus({days: 30})).get()
                          .then(coll =&gt; {
                              coll.forEach(doc =&gt; {
                                  if(doc.exists){
                                      run.db.collection('sites').doc(site.id).collection('comments').doc(doc.id).delete();
                                  }
                              });
                          });
                  }
              });
          });
  </code></pre>
  
  <p>This function seems it would be resource heavy, since I have to first get an unknown list of sites, then run another query for every sites comments, where the day the user pressed the delete button is less than today minus 30 days.</p>
  
  <p>I want to try and keep my reads and writes as low as possible for obvious <a href="https://firebase.google.com/docs/firestore/pricing" rel="nofollow noreferrer">reasons</a>.</p>
  
  <p>Is there a more efficient way of doing this?</p>