ShubhamOriginal post
Rank 3: Container
Plain text
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) ])Summary
Developers are trying to fetch data from one day before, but the code is resulting in a server error. The issue may be with how the date is being handled. One suggestion is to use .toISOString(), and another idea is to check if the code works without queries.