
Hello, I have been trying to list documents containing the following query:
const min = (+val.minimum).toFixed(2) // ex. "51.23"
const max = (+val.maximum).toFixed(2) // ex. "82.12"
const result = await this.database.listDocuments(
db.databaseId,
Collection.IMAGES,
[
Query.greaterThanEqual("score", min),
Query.lessThanEqual("score", max),
]
);```
but I keep getting the following response error:
```json
{
"message": "Query not valid: Query type does not match expected: double",
"code": 400,
"type": "general_argument_invalid",
"version": "1.2.0"
}```
the score attribute is a Float Attribute in the db
what is the correct way to query for double with appwrite?

Weird...this seems fine...are you able to see what's sent in the network request?

yup, here's what the raw payload looks like: queries%5B0%5D=greaterThanEqual%28%22score%22%2C+%5B%2251.23%22%5D%29&queries%5B1%5D=lessThanEqual%28%22score%22%2C+%5B%2292.12%22%5D%29&queries%5B2%5D=orderDesc%28%22score%22%29
heres how it looks decoded: queries[0]: greaterThanEqual("score", ["51.23"]) queries[1]: lessThanEqual("score", ["92.12"]) queries[2]: orderDesc("score")

seems like this is related to this issue: https://github.com/appwrite/appwrite/issues/4340

That issue is for passing integers but you're passing decimal numbers

Can you try to not use double quotes around the numbers?

this one worked lol, thank you!

but still for integers i would have to do a workaround like if the value is 50 - then i would just subtract 0.1 from it

[SOLVED] How to Query for Double Attribute

Yes, hopefully, the fix will be in the next release
Recommended threads
- I am facing this error: type 'Null' is ...
When attempting to fetch areas from the area collection, the application throws an error: "type 'Null' is not a subtype of type 'int.'" This issue originates in...
- Adding custom domain to Appwrite project
My app is hosted on Vercel on domain todo.velleb.com. On PC, the OAuth logins like GitHub, Discord and Google work and create the account and log in. On mobile ...
- #support
<#1072905050399191082> any help on that?
