I have the following listDocuments query in Dart server function:
TypeScript
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?
TL;DR
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.Recommended threads
- Functions never end and always fail (sta...
Hi ! I'm using Appwrite Cloud Pro and function execution from appwrite website is KO. Deploying starter function template, execution is always Failed and the ...
- Provider error when creating a function ...
- 1:1 relationship doesn’t sync after re-a...
Hi, I’m trying to use a two-way one-to-one relationship. It works fine when I create a record with the relationship set, and it also works when I unset it. But ...