title: How can I dynamically create Firebase Firestore Cloud Function queries?
body: <p>I'm trying to dynamically generate queries.</p>
  
  <p>I have a big object of things like location and price data. But I get that data from the request. How can I dynamically make use of that data if every query thing is a chained function?</p>
  
  <p>Ideally I'd like to convert something like this...</p>
  
  <pre><code>const wheres = [
    { key: 'price', operator: '&gt;=', value: '1000' },
    { key: 'price', operator: '&lt;=', value: '2000' }
  ]
  </code></pre>
  
  <p>...to...</p>
  
  <pre><code>admin
        .firestore()
        .collection(`rentals`)
        .where(`price`, `&gt;=`, `1000`)
        .where(`price`, `&lt;=`, `2000`)
  </code></pre>