With latest version of: Flutter + cloud_firestore: ^0.14.0+2
Code:
FutureBuilder(
future: _sessionsLogCollection
.where('companyId', isEqualTo: sPData.companyId)
.where('locationId', arrayContainsAny: [
'29L73oSzdQrzLUow3Mg9',
'bugdWVC6RRtHoemuxNWE',
])
// .where('locationId', isEqualTo: 'bugdWVC6RRtHoemuxNWE')
.orderBy('openDateTime', descending: true)
.get(),
I already have indexes created, so that isn't the problem.
When using .where('locationId', isEqualTo: 'bugdWVC6RRtHoemuxNWE') alone, the query returns the correct data.
But with .where('locationId', arrayContainsAny: ['29L73oSzdQrzLUow3Mg9','bugdWVC6RRtHoemuxNWE']) alone, it does not give any error, but simply returns empty data set: sessionsSnapShot.data.documents.length: 0.
** Solved with .whereIn (Probably .whereIn should be included at firebase.flutter.dev/docs/firestore/usage as it is not currently there)