'Does Flutter Firestore Where clause not support "OR ||" operator
StreamBuilder( stream: _firestore .collection('MessageData') .where( 'RecieverId', isEqualTo: RecieverId) .where('SenderId', isEqualTo: _auth.currentUser!.uid) //I Want OR operator here logicaly. How can i do this? .where( 'RecieverId', isEqualTo: _auth.currentUser!.uid) .where('SenderId', isEqualTo: RecieverId) .snapshots(), builder: (context, snapshot) { return ListView( children: snapshot.data!.docs.map((e) { return Text(e['Message']); }).toList(), ); }, )
Please go this link to see firestore image.
Solution 1:[1]
Use in operator. This allow to check up to 10 equalities according to documentation.
See https://firebase.google.com/docs/firestore/query-data/queries#in_and_array-contains-any
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Kantine |
