I'm developing an eCommerce website using Next.js and Appwrite.
To get all documents from Appwrite Database, I'm using Query.greaterThanEqual("stock", 0), but I'm getting only products having stock > 0.
6 messages · Page 1 of 1 (latest)
I'm developing an eCommerce website using Next.js and Appwrite.
To get all documents from Appwrite Database, I'm using Query.greaterThanEqual("stock", 0), but I'm getting only products having stock > 0.
What type is the attribute? Did you set it to 0 or was it a default value?
Attribute type is Integer.
And default value is 0.
But I tried changing value at Cloud Console, and reset it to 0, then also not working.
weird it works for me. does it work for you in the console?
i also tried this:
{"method": "and", "values": [
{method: "greaterThanEqual", attribute: "i", values: [0]},
{method: "greaterThanEqual", attribute: "i", values: [0]}
]}
and it worked
I'm really sorry.
The bug was in my code only. Just checked! 😬