ckingprogramming
ckingprogramming

Reputation: 343

Streambuilder not working with Firebase query with multiple where clause

The following stream works when there's only one where query, but when there's multiple where queries the stream no longer works. Does anyone have any insights to this? Thanks!

StreamBuilder(
                        stream: FirebaseFirestore.instance
                            .collection('activities')
                            .where('userID', isNotEqualTo: currentUserID)
                            .where('audience', isEqualTo: 'Public')
                            .snapshots(),

Upvotes: 1

Views: 350

Answers (1)

iDecode
iDecode

Reputation: 28976

You can't combine two queries if one of your queries includes isNotEqualTo clause.

You'll have to use a single query (or combine it one by one) on the client side.

Upvotes: 2

Related Questions