I'm using Firestore and trying to get all the documents under the root collection. I'm facing strange behaviour, I gets only those documents which were I added manually. I tried this, this and many other solutions like these but not getting all the documents.
Here's my Firebase structure
One more thing which is noticeable, the 1st document under users collection which had I added by code looks italic and the other one looks normal & I'm only getting 2nd one in the logcat which is added manually.
Here's my code
FirebaseFirestore.getInstance().collection("users")
.get()
.addOnCompleteListener(new OnCompleteListener<QuerySnapshot>() {
@Override
public void onComplete(@NonNull Task<QuerySnapshot> task) {
if (task.isSuccessful()) {
for (QueryDocumentSnapshot document : task.getResult()) {
Log.e("===>>>>", document.getId() + " => " + document.getData());
}
} else {
Log.d("===>>>>", "Error getting documents: ", task.getException());
}
}
});
Here's my logcat
What is the proper way to get all the doc, does't matter it should be added by code or manually!