Reputation: 176
I'm trying to use
FirebaseFirestore.instance
.collection('Jobs')
.where('types', arrayContainsAny: selectedRooms)
.orderBy('types', descending: true)
.orderBy('date', descending: true)
.limit(30)
.get();
I've already checked
- types: asc
- date: asc
Update:
JobID: UID
publisherName: String
Types: Array<String>
date: Timestamp
title: String
address: String
Any Help will be appreciated! Happy Coding
Upvotes: 0
Views: 52
Reputation: 176
After several tries without success I've managed to solved this by using the
Firebase QueryBuilder
Basically what this does it shows a new type to use in the index which is Array
Otherwise not selectable if you create the index by yourself. So the new Generated Index is
- types: Array
- date: asc
While keeping the same query as mentioned on the question this solved my problem.
Thanks to everybody!
Upvotes: 1