I use Cloud Firestore and I need to somehow do multi-requests

This can be compared with the subscription system.

The code of what I use below

private CollectionReference ref; ref = firebaseFirestore.collection("Data"); 

After the announcement is an interesting thing: I go to the collection where users are and download data by name

 for (DocumentChange doc : documentSnapshots.getDocumentChanges()) { ref.whereEqualTo("name", doc.getDocument().getId()); } 

And then there is a problem, because, as I understand it, he first looks for a descent to the first name, and then he looks for a different name for the files that he selected, but since they are not there, because they were selected by another name, he downloads everything ( without clumsy pictures in Paint post - not post)

Picture explanation:

Suppose I have a DB and it has three colors: black, red, green

I need red and green

 ArrayList<String> color = new ArrayList<>(); color.add("green"); color.add("red"); 

I write in a loop

 for (int i = 0; i < color.size(); i++) { ref.whereEqualTo("color", color.get(i)); } 

What makes DB:

enter image description here

What do I want her to do? I want to first load all the filters and then go search in the database

for example

enter image description here

I rummaged through half the site on Firebase - nothing is empty on Stack, no one knows in chat rooms, they make such game stupid on commercials with counterparts

 for (DocumentChange doc : documentSnapshots.getDocumentChanges()) { ref.whereEqualTo("name", doc.getDocument().getId()); ref.collection()... } 

But this is not the best idea because it cannot be sorted by date and it will download the entire database: do not set a limit, because there will be a limit - they will download everything a little, but for example the post from 2015 can be higher than the post from yesterday

    0