const oneDayAgo = new Date();
oneDayAgo.setDate(oneDayAgo.getDate() - 1);
const result=await database.listDocuments(databaseid, collectionId,[
Query.limit(50),
Query.orderDesc("$createdAt"),
Query.greaterThan("$createdAt",oneDayAgo),
Query.lessThan("$createdAt",today)
])
Please explain more what your issue is, what errors do you have? Is there anything else we need to know?
it says server error
So a 500 I'm guessing. Can you try without queries and see if that works?
yes its not working after Query.greaterThan("$createdAt",oneDayAgo)
what does oneDayAgo variable result in?
its return a date
try using .toISOString()
Recommended threads
- 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...
- Invalid document structure: missing requ...
I just pick up my code that's working a week ago, and now I got this error: ``` code: 400, type: 'document_invalid_structure', response: { message: 'Inv...