mColRef.document(mUid).get().addOnSuccessListener(new OnSuccessListener<DocumentSnapshot>() {
@Override
public void onSuccess(DocumentSnapshot documentSnapshot) {
List<String> list = (ArrayList<String>) documentSnapshot.get("contact");
}
});
ANDROID-JAVA: I have an Array field in Firestore users_list, which may be contains 5k to 10k String values. I want to make sure all data loaded completely in List list, and only then I can perform another operations. Please tell me how to know all data loaded successfully from Firestore array. Thanks in advance...
CodePudding user response:
Any time you perform a Firestor query, all of the results of that query are available when the onSuccess callback is is invoked.
The snapshot argument to the callback contains all of the document data, so when you call documentSnapshot.get()
, the entire results are available. There is no such thing as a partially loaded document. It is all or nothing.