I am trying to check where the document exists in the collection or not. but when I make query it returns false but as you see in photo document is exists, so where I am doing wrong?
public MutableLiveData<Boolean> isConversationNodeExsits(String documentID) {
if (isConversationNodeExsits == null ) {
isConversationNodeExsits = new MutableLiveData<>();
db.collection(Constants.CONVERCTION_ID)
.document("13005065233@umt,edu,pk---sifusir@fidelium10,com")
.get()
.addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {
@Override
public void onComplete(@NonNull Task<DocumentSnapshot> task) {
if (task.getResult().exists()) {
Log.d(TAG, " conversation node exists ");
isConversationNodeExsits.setValue(true);
} else {
Log.d(TAG, " conversation node not exists " + task.getResult().getReference().getPath());
isConversationNodeExsits.setValue(false);
}
}
});
}
return isConversationNodeExsits;
}