I am getting this error Query is not defined, when I try to retrieve the documents
I am not sure why, here is my function
let promise = databases.listDocuments(
"647ac763cf53edxxxx",
"647ac820ba38520xxxxx",
[
Query.orderDesc("age")
]
);
promise.then(function (response) {
console.log(response);
}, function (error) {
console.log(error);
});```
Have you created an index for the age attribute?
yes
but none of the queries are working
Are you appwrite cloud or its self hosted?
cloud
Do you import Query ?
you mean here const { Client, Account, ID, Functions, Databases} = Appwrite;?
I imported it now it works
thanks😅
Recommended threads
- Failed to receive appwrite reset passwor...
Hey there, I forgot my password for my appwrite account but when i use forgot password, i dont get an email to reset the account but when i try to create a new ...
- Using Binary Log with Appwrite
If I can remember correctly appwrite uses mariaDB as the underlying database. If so could I use mariaDB’s binary log to see database operations from appwrite?
- Domain Help
My domain estimately.me is verified in Appwrite DNS but SSL certificate keeps failing with: DNS problem: server failure at resolver looking up A for estimately....