In my Firestore I\'ve got a users
collection, within which the documents could have a bookmarks
field, which is an array of references:
Yes it is. Please see the following lines of code:
FirebaseUser firebaseUser = FirebaseAuth.getInstance().getCurrentUser();
if (firebaseUser != null) {
String uid = firebaseUser.getUid();
rootRef.collection("users").document(uid).get().addOnCompleteListener(new OnCompleteListener() {
@Override
public void onComplete(@NonNull Task task) {
if (task.isSuccessful()) {
DocumentSnapshot document = task.getResult();
if (document.exists()) {
List list = (List) document.get("bookmarks");
List> tasks = new ArrayList<>();
for (DocumentReference documentReference : list) {
Task documentSnapshotTask = documentReference.get();
tasks.add(documentSnapshotTask);
}
Tasks.whenAllSuccess(tasks).addOnSuccessListener(new OnSuccessListener>() {
@Override
public void onSuccess(List
So the List
is actually the list that contains objects of type TeacherPojo
.