title: How to perform a firestore query inside a Firebase function?
body: <p>I have a firestore query inside my firebase function that is used to retrieve a document if it has a specific value inside it (eg: if the name field is equal to "name"). I have written the code and declared the function as a functions.https.onCall so I can call it within my app. Calling the function works however it doesn't do anything when it has started. 
  Here is the query that I have written that is causing the problem:</p>
  
  <pre><code>let query = admin.firestore().collection('...').where('...', '==', value).orderBy('...').limit(1);
          query.get().then(snapshot =&gt; {
              let ... = snapshot[0];
  </code></pre>
  
  <p>Here is my function declaration: </p>
  
  <pre><code>exports.functionName = functions.https.onCall((data, context) =&gt; {
  
  </code></pre>
  
  <p>What the function should do is log what was passed into it from the calling code, perform the query (currently testing with valid data), and continue with the rest of the function. Right now it doesn't do anything but when I remove the where function it works but cannot get the specific document I am looking for. Thank you for any insights into my problem. </p>