I am creating a flutter app that should query a Firestore collection and return results if two conditions are met. Here is my code:
Stream<List<FormQuestions>> get question {
return someCollection
.where('myQUestion', isEqualTo: 'nameQuestion')
.snapshots()
.map(_someQuestionListFromSnapshot);
}
If I do with just one .where() condition, it works fine. But with two, it gives no results although I have documents that meet both conditions. I would like it to return for multiple .where() conditions like so:
Stream<List<FormQuestions>> get question {
return someCollection
.where('myQUestion', isEqualTo: 'nameQuestion')
.where('myQuestion', isEqualTo: 'ageQuestion')
.snapshots()
.map(_someQuestionListFromSnapshot);
}
Is there a way to add an OR(||) operator or how can I do this so that I get results for both "nameQuestion" and "ageQuestion"? Kindly assist. Thanks.