title: How to retrieve all document ids from a collection?
body: <p>I'm trying to get all of the document ids in a collection <code>groups</code>. The document id is the group name which is unique. Also each document in <code>groups</code> <strong>does not have fields</strong>, only pointers to other collections. I wrote the following code:</p>
  <pre><code>fireDB.collection(&quot;groups&quot;).get().addOnCompleteListener(new OnCompleteListener&lt;QuerySnapshot&gt;() {
      @Override
      public void onComplete(@NonNull Task&lt;QuerySnapshot&gt; task) {
          if (task.isSuccessful()) {
              QuerySnapshot querySnapshots = task.getResult();
              if (querySnapshots != null) {
                  for (QueryDocumentSnapshot currentDocumentSnapshot : querySnapshots) {
                      groups.add(currentDocumentSnapshot.getId());
                  }
                  Collections.sort(groups);
                  ArrayAdapter&lt;String&gt; adapter = new ArrayAdapter&lt;&gt;(SignUpActivity.this,android.R.layout.simple_list_item_1,groups);
                  groupNameText.setAdapter(adapter);
              } else {
                  Log.d(this.getClass().getName(), &quot;No groups in the database&quot;);
              }
          } else {
              Log.d(this.getClass().getName(), &quot;addOnCompleteListener:failed&quot;);
          }
      }
  });
  </code></pre>
  <p>But <code>groups</code> is always empty because firebase does not give me documents without fields (figured it out after some debugging). How should I do it?</p>