title: Firestore : query all documents from a collection
body: <p>My Firestore structure looks something like this: </p>
  
  <pre><code>-(coll)users
      -(doc)uniqueID  
      name
      email  
      (coll)clients
          -(doc)uniqueID
          clientName
          clientEmail  
  </code></pre>
  
  <p>What I am trying to achieve is the following: </p>
  
  <ol>
  <li>The user signs in through FirebaseUI Auth flow  </li>
  <li>If the user (uid recovered from Auth) doesn't exist in firestore db I create a document named by his uid  </li>
  <li>Once I have the uid I run a query to load clients collection in order to display them into a list using a RecyclerView (if the collection is empty hence the user hasn't created any clients yet I display an empty list screen)  </li>
  </ol>
  
  <p>I tried to make a query using the code below as per the <a href="https://firebase.google.com/docs/firestore/query-data/get-data#get_all_documents_in_a_collection" rel="nofollow noreferrer">documentation</a>:  </p>
  
  <pre><code>    clientsCollection = db.collection(FIRESTORE_COLLECTION_USERS)
              .document(mUid)
              .collection(FIRESTORE_COLLECTION_CLIENTS);
  
      clientsCollection
              .get()
              .addOnCompleteListener(new OnCompleteListener&lt;QuerySnapshot&gt;() {
                  @Override
                  public void onComplete(@NonNull Task&lt;QuerySnapshot&gt; task) {
                      if (task.isSuccessful()){
                          for (DocumentSnapshot document: task.getResult()){
                              Log.d(LOG_TAG, document.getId() + " =&gt; " + document.getData());
                          }
                      } else {
                          Log.d(LOG_TAG, "error getting documents: ", task.getException());
                      }
                  }
              });
  </code></pre>
  
  <p>I get the following <code>RuntimeException</code>:</p>
  
  <pre><code>java.lang.NullPointerException: Provided document path must not be null.
  </code></pre>
  
  <p>I get this even if the clients collection exits with some documents in it named by unique uid.</p>
  
  <p>Thanks for any clue you could give me! :)</p>