title: Fetching firestore doc id with where condition
body: <p>I am trying to fetch Firestore doc id using this command below:</p>
  
  <pre><code>const ref = firebase.firestore().collection('cities').where('name', '==', 'JALANDHAR').get();
  console.log(ref);
  </code></pre>
  
  <p>In console, it shows this:</p>
  
  <p><a href="https://i.stack.imgur.com/pmsrV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/pmsrV.png" alt="enter image description here"></a></p>
  
  <p>I want to fetch the <code>ID</code> in image</p>
  
  <p>I am trying like this - <code>const docRefId = ref.docs[0].id</code> but it is giving error - <code>Property 'docs' does not exist on type 'Promise&lt;QuerySnapshot&lt;DocumentData&gt;&gt;</code></p>
  
  <h2>Edit 1</h2>
  
  <p>Trying with query snapshot like this:</p>
  
  <p><code>const ref = firebase.firestore().collection('cities').where('name', '==', 'JALANDHAR').get()
  .then(querySnapshot =&gt; {
    const docRefId = ref.docs[0].id;
  })</code></p>