title: How to check unique alias in cloud firebase?
body: <p>i want to check nick name in hashmap but i didn't get all document from cloud firebase? How can i do that? Thanks in advance.</p>
  <pre><code>val db = Firebase.firestore
  val docRef = db.collection(&quot;User&quot;).document()
  docRef.get().addOnSuccessListener { documents-&gt;
      
      if (documents != null) {
  
          val obj= documents.get(&quot;Basic Information&quot;) as HashMap&lt;*, *&gt;
          val checkNick= obj[&quot;nick&quot;].toString()
  
          if (checkNick == nick){
              Toast.makeText(activity, &quot;exists.&quot;, Toast.LENGTH_LONG).show()
          }
  
      } else {
          Log.d(TAG, &quot;No such document&quot;)
      }
  }
  </code></pre>