Hello I have a question about google firestore, I have read that it is impossible to create and clause queries but I need a query like this but if I made it like this it fill my memory garbage. Do you have any solution to make a similar query to keep fast and optimized execution ?
getPlaceByZipCode(int selectedZipCode) {
try {
_resultFoundPlacesStream = FirebaseFirestore.instance
.collection(PLACES_COLLECTION)
.where('cityZipCode', isEqualTo: selectedZipCode)
.snapshots()
.listen((event) {
event.docs.map((e) {
if (e.get('ownerId') == null)
_resultFoundPlaces
.add(PlaceModel.fromDocumentSnapshot(documentSnapshot: e));
}).toList();
print(_resultFoundPlaces.length.toString() +
' Places found located in ' +
selectedZipCode.toString());
});
} catch (e) {
Get.snackbar('app_error'.tr, 'app_error_description'.tr);
}
}