i have a firestore Query like so:
docRef.whereEqualTo("A",1).whereEqualTo("B",3) OR docRef.whereEqualTo("A",2).whereEqualTo("C",3)
As this is not possible with a single query in firebase I'd like to merge them clientside. I found a post on SO where you just use the task objects and wait for them to complete. But i really do want to have the ListenerRegistration and use that query for live updates. What is the best way to get life updates for the combined or query.
BTW: This is the code i was talking about (Taken from https://stackoverflow.com/a/50132229)
FirebaseFirestore rootRef = FirebaseFirestore.getInstance();
Query firstQuery = rootRef...
Query secondQuery = rootRef...
Task firstTask = firstQuery.get();
Task secondTask = secondQuery.get();
Task combinedTask = Tasks.whenAllSuccess(firstTask, secondTask).addOnSuccessListener(new OnSuccessListener<List<Object>>() {
@Override
public void onSuccess(List<Object> list) {
//Do what you need to do with your list
}
});