title: How can i get the fields in firestore database which is inside Collection>Documents>Collection>Document?
body: <p>How can I get the fields of my Firestore database? My fields are in a nested way. First is <code>Collection</code> &gt; Then <code>Document</code> &gt; Then <code>Collection</code> &gt;<code>Document</code>&gt; Then the <strong><code>Fields</code></strong>.</p>
  <pre><code>        dataBabe.collection(&quot;categories&quot;)
                  .document(catId)
                  .collection(&quot;quesansforquiz&quot;)
  
                  .addSnapshotListener(new EventListener&lt;QuerySnapshot&gt;() {
                      @Override
                      public void onEvent(@Nullable @org.jetbrains.annotations.Nullable QuerySnapshot value, @Nullable @org.jetbrains.annotations.Nullable FirebaseFirestoreException error) {
                          if (!value.isEmpty()) {
  
                              List&lt;DocumentSnapshot&gt; list = value.getDocuments();
                              questionslist.clear(); //clear old refresh new
                              for (DocumentSnapshot d : list) {         //2:31:04 vid
                                  // after getting this list we are passing
                                  // that list to our object class.
                                  Ques ud = d.toObject(Ques.class);
                                  ud.setOp1(d.getId());
  
                                  // and we will pass this object class
                                  // inside our arraylist which we have
                                  // created for recycler view.
                                  questionslist.add(ud);
                              }
                              ptoAdapter.notifyDataSetChanged();
                          } else {
                              // if the snapshot is empty we are displaying a toast message.
                              Toast.makeText(getApplication() , &quot;No data found in Database&quot;, Toast.LENGTH_SHORT).show();
                          }
                      }
                  });```
  
  
  
  [![pic1][1]][1]
  [![pic2][2]][2]
  [![pic3][3]][3]
  
  
    [1]: https://i.stack.imgur.com/kdh65.png
    [2]: https://i.stack.imgur.com/nVS2I.png
    [3]: https://i.stack.imgur.com/hcxbJ.png
  </code></pre>