I'm querying against my "GroupConvos" collection where the documents all have a memberIds
string array with Ids about members that belong to that group and doing the following query for GroupConvos
gives me with a broken link
self.db.collection(kGroupConvos)
.order(by: kUpdatedAt, descending: true)
.whereField("memberIds", arrayContains: self.currentUserId)
.limit(to: 20)
.getDocuments { [weak self] snapshot, error in
if let error = error {
print(error)
} else { ... }
The query requires an index. You can create it here: {link}
Image:
So I went into the console and created an index:
And I keep getting that same error when I do my query. Any suggestions as to what to do here?
If you're using array-contains to search a field, it looks like you need to add an Array Contains type index to it:
Notice that you have an option for that. It looks like what you did instead was make memberIds an Ascending type field index.