I am trying to get documents, that were created 24h ago or earlier. my code doesn't work (I just get {"total":0,"documents":[]}). What am I doing wrong is there a better way to do it?
TypeScript
const offset = (24 * 60 * 60 * 1000);
const date = new Date();
date.setTime(date.getTime() - offset);
let promise_get = databases.listDocuments(
dbToUse,
collectionToUse,
[
Query.lessThan('$createdAt', date)
]
);
TL;DR
The developer is trying to query documents that were created 24 hours ago or earlier. They have tried using the code `Query.lessThanEqual("$createdAt", date)`, but it is not working. They are asking for help on what they may be doing wrong and if there is a better way to achieve this.try this:
TypeScript
Query.lessThanEqual("$createdAt", date),
Recommended threads
- education plan not activated
Hi I have an edu id 13103046@iubat.edu but when I am trying to claim my plan and trying to logging with github where education student plan active. the appwrite...
- I'm getting an error on the console "j?....
On my self hosted instance version 1.8.1 the console is giving me this error when trying to view the rows for a table I recently created. My application is read...
- 500 simultaneous OAuth logins from the s...
Hi, I'd like to ask about rate limiting around Google OAuth login on Appwrite Cloud. **OVERVIEW** Service type: A PWA (web app) for members of a university clu...