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
- self-hosted auth: /v1/account 404 on saf...
Project created in React/Next.js, Appwrite version 1.6.0. Authentication works in all browsers except Safari (ios), where an attempt to connect to {endpoint}/v1...
- delete document problems
i don't know what's going on but i get an attribute "tournamentid" not found in the collection when i try to delet the document... but this is just the document...
- Attributes Confusion
```import 'package:appwrite/models.dart'; class OrdersModel { String id, email, name, phone, status, user_id, address; int discount, total, created_at; L...