How do I get the highest score from within a date range in a single request on firebase firestore?
await Firestore.collection(CollectionName.post)
.orderBy("score")
.where("publishedAt", ">", Firebase.firestore.Timestamp.fromDate(GetDateAndMinus(24)))
.where("publishedAt", "<=", Firebase.firestore.Timestamp.now())
.get(),
});
Invalid query. You have a where filter with an inequality (<, <=, >, or >=) on field 'publishedAt' and so you must also use 'publishedAt' as your first orderBy(), but your first orderBy() is on field 'score' instead.