MatanB
MatanB

Reputation: 81

flutter firebase is there any query to make OR query on fields?

This is my stream:

stream: chatRef
          .where('id', isEqualTo: this.currentUserId)
          .orderBy('timeStamp', descending: true)
          .snapshots(),

I want to make a query where 'id is equal to this.currentUserId OR 'otherId' is equal to this.currentUserId but i cant find a simple way to do that...

Upvotes: 0

Views: 21

Answers (1)

Jigar Patel
Jigar Patel

Reputation: 5423

Try this.

.where('id', whereIn: [this.currentUserId, otherId])

Upvotes: 1

Related Questions