Multiple Orderby Firestore Query crashes.

138 views
Skip to first unread message

ibas...@gmail.com

unread,
Dec 17, 2021, 12:47:35 PM12/17/21
to Firebase Google Group
Hello guys, I am trying to use multiple fields orderBy along with wherenotequalto operator. My code is not working. If anyone can help how to use multiple orderby and wherenotequalto together.
My sample code:
Query q = collectionReference.whereNotEqualTo("uid", uid).orderBy("age").startAt(18).endAt(28).orderBy("geohash").startAt(b.startHash).endAt(b.endHash);

Thanks in Advance

Tracy Hall

unread,
Dec 17, 2021, 11:57:34 PM12/17/21
to Firebase Google Group
including:
"If you include a filter/where clause with a range comparison (<<=>>=), your first ordering must be on the same field:"
Note that notEqualTo is *also* an inequality/range comparison

Tracy Hall

Reply all
Reply to author
Forward
0 new messages