return firestore
.collection('chatrooms')
.where('participants', arrayContains: userId)
.where('chatType', isEqualTo: 'friend')
.where('visibility.$userId.visible', isEqualTo: true)
.orderBy('lastMessageTime.$userId', descending: true)
.snapshots()
and now its creating the composite index like this.
participants Arrays chatType Ascending visibility.
8YvAhlkrD6Qzcu3XgXTdJxInghF2.visible Ascending lastMessageTime.
8YvAhlkrD6Qzcu3XgXTdJxInghF2 Descending __name__ Descending
i want that this will not happen.
1