title: If data not exists in the Firestore using Collection
body: <p>I just want to know if the user enter a value that did not exist <em><strong>for eg: XYZ654</strong></em> that was not exists in Firestore.</p>
  <p>Here's my code:</p>
  <pre><code>CollectionReference reference = firestore.collection(&quot;Users&quot;);
      reference.whereEqualTo(&quot;ReferCode&quot;, binding.refferalEd.getText().toString().toUpperCase()).get()
              .addOnCompleteListener(new OnCompleteListener&lt;QuerySnapshot&gt;() {
                  @Override
                  public void onComplete(@NonNull Task&lt;QuerySnapshot&gt; task) {
                      if (task.isSuccessful()) {
                          for (QueryDocumentSnapshot snapshot : task.getResult()) {
                              String RefreeMobile = snapshot.getString(&quot;Mobile&quot;);
                              Log.e(TAG, &quot;mobile: &quot; + RefreeMobile);
                              dialog.dismiss();
  
  
                              WriteBatch batch = firestore.batch();
  
                              // Some Code here. . .
  
                              
                          }
                      } else {
                          Log.e(TAG, &quot;Error getting documents: &quot;, task.getException());
                      }
                  }
              });
  </code></pre>
  <blockquote>
  <p>If here <strong>binding.refferalEd</strong> the user was put the wrong referral that was not exist in the Firestore then I want to set Error in the EditText but Confused where I describe that:</p>
  </blockquote>
  <p><a href="https://i.stack.imgur.com/8VooN.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/8VooN.png" alt="Details" /></a>
  <a href="https://i.stack.imgur.com/MwsVM.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/MwsVM.png" alt="Details" /></a></p>