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
- Seed db
hello there... is this correct way to seed appwrite
- Query Appwrite
Hello, I have a question regarding Queries in Appwrite. If I have a string "YYYY-MM", how can I query the $createdAt column to match this filter?
- Different appwrite IDs are getting expos...
File_URL_FORMAT= https://cloud.appwrite.io/v1/storage/buckets/[BUCKET_ID]/files/[FILE_ID]/preview?project=[PROJECT_ID] I'm trying to access files in my web app...