title: how to get root document fields of collection in firestore android
body: <p>I want to get the document fields of the root collection in android <strong>firestore</strong></p>
  
  <p>my database structure in firestore is</p>
  
  <pre><code>collection
        documents--&gt;root fields
                 collection
                            documents--&gt;fields
  </code></pre>
  
  <p>now i want to get root fields. How to do that in android firestore?</p>
  
  <pre><code>firestore.collection("Players").orderBy("deptName").get().addOnCompleteListener(new OnCompleteListener&lt;QuerySnapshot&gt;() {
          @Override
          public void onComplete(@NonNull Task&lt;QuerySnapshot&gt; task) {
              if (task.isSuccessful()) {
  
                  for (QueryDocumentSnapshot document : task.getResult()) {
  
                      //model class
                      Example example=document.toObject(Example.class);
                      exampleList.add(example);
  
                  }
  
  
                  Toast.makeText(getActivity(), ""+exampleList, Toast.LENGTH_LONG).show();
  
              } else {
                  Toast.makeText(getActivity(), ""+task.getException(), Toast.LENGTH_SHORT).show();
              }
          }
      });
  </code></pre>