title: Google Cloud Firestore: How to list document with subcollections?
body: <p>I'd like to get document ids from this database structure.<br>
  In other words, I'd like to get list(2019, 2020...) from following database.</p>
  
  <p><a href="https://i.stack.imgur.com/yUVAM.png" rel="nofollow noreferrer">scrrenshot</a></p>
  
  <p>I use javascript. (web client)<br>
  And following code does not work well.<br>
  <code>querySnapshot.docs</code> is empty array.</p>
  
  <pre class="lang-js prettyprint-override"><code>getYears() {
    const { currentUser } = firebase.auth();
    const db = firebase.firestore();
    const query = db.collection(`users/${currentUser.uid}/statics`);
    query.get()
      .then((querySnapshot) =&gt; {
        console.log('querySnapshot', querySnapshot);
        querySnapshot.forEach((docSnapshot) =&gt; {
          console.log('docSnapshot id', docSnapshot.id);
        });
      })
      .catch((err) =&gt; {
        console.log('err', err);
      });
  </code></pre>