db.collection("chatrooms")
.document(group_name)
.collection("chats")
.document()
.get().addOnCompleteListener(new OnCompleteListener<DocumentSnapshot>() {
@Override
public void onComplete(@NonNull Task<DocumentSnapshot> task) {
if(task.isSuccessful()){
int size = task.getResult().getData().size();
}
}
});
This does not work on implementation 'com.google.firebase:firebase-firestore:21.0.0'. Any work around will be highly appreciated.
on Firebase database, there was getChildrenCount method, on firestore i can't find any method which can give me count on the documents.