Tommy AngeloOriginal post
Rank 1: Thread
I have the following listDocuments query in Dart server function:
await databases.listDocuments(
databaseId: "game",
collectionId: "airports",
queries: [
Query.offset(offset),
Query.limit(limit),
Query.greaterThan("runway_count", 0),
Query.or([
Query.equal("type", "small_airport"),
Query.equal("type", "medium_airport"),
Query.equal("type", "large_airport"),
]),
],
)
Here, greaterThan query seems not working. It successfully filters airports by type, however also returns airports with runway_count == 0. runway_count is a required integer attribute for the collection. Do you have any idea what might be the reason for that to be ignored?
Summary
The developers are facing an issue where the `greaterThan` query for `runway_count` in a Dart server function is not working as expected, still returning airports with `runway_count == 0`. The issue seems to stem from improper usage of the `greaterThan` query. To resolve this, `Query.greaterThan("runway_count", 0)` should be replaced with `Query.greaterThan("runway_count", Value.fromInt(0))` to effectively filter out airports with a `runway_count` of 0.