Back

Query type does not match expected: double

  • 0
  • Databases
  • Web
Bouahaza
17 Jun, 2023, 09:45

Can you show configuration of your attributs ?

TL;DR
Query type mismatch error when passing values in JavaScript. Possible solution: Pass numbers as strings or use the Number('56.0') function to convert them to double values. A bug on Appwrite's side may be causing the issue, and it is already fixed in a new version that is not yet available on the cloud. Check the attribute configuration for any issues.
Bouahaza
17 Jun, 2023, 09:45

Are you on cloud or self hosted ?

Ketan Saraf
17 Jun, 2023, 09:47

Cloud

Ketan Saraf
17 Jun, 2023, 09:47

I think this is a bug on Appwrite's side

Ketan Saraf
17 Jun, 2023, 09:48

I am passing 56 to breadth which needs Double value

Ketan Saraf
17 Jun, 2023, 09:48

It is failing then

Ketan Saraf
17 Jun, 2023, 09:48

But if I pass 56.5 to breadth, it will pass

Bouahaza
17 Jun, 2023, 09:50

Yes, to query float type on cloud, you need to pass float

Bouahaza
17 Jun, 2023, 09:51

It's fix with new version (wich isn't already on cloud)

Ketan Saraf
17 Jun, 2023, 09:51

Yes, in JavaScript every number is float by default

Ketan Saraf
17 Jun, 2023, 09:51

Will passing string work?

Bouahaza
17 Jun, 2023, 09:51

Nope

Ketan Saraf
17 Jun, 2023, 09:51

Yes tried it

Ketan Saraf
17 Jun, 2023, 09:52

didnt work

safwan
17 Jun, 2023, 11:59

then try passing 56.0 and see if it works

Ketan Saraf
17 Jun, 2023, 12:01

Not possible in JavaScript

safwan
17 Jun, 2023, 12:02

um is that so? i don't think i've faced any issues with .0 🤔

Ketan Saraf
17 Jun, 2023, 12:03

see I am storing these values in a variable, if there is 56.0 value, JavaScript will automatically turn it into 56

safwan
17 Jun, 2023, 12:04

I mean I might be wrong.

Why don't you pass a string like Number('56.0') or something

safwan
17 Jun, 2023, 12:04

Not sure why this is happening tbh

safwan
17 Jun, 2023, 12:04

I'm gonna test this on my end

Ketan Saraf
17 Jun, 2023, 12:04

Okay, but you can't pass string as well. I tested that

Ketan Saraf
17 Jun, 2023, 12:04

It's a bug that needs to be solved

Drake
17 Jun, 2023, 15:26

Are you on cloud?

Ketan Saraf
18 Jun, 2023, 10:32

yes

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more