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
- Go 1.25 runtime
So I'm trying to use go 1.25 for my functions and I can only find go-1.23 as a function runtime. So I did some searching and found https://github.com/appwrite/a...
- [ENHANCEMENT] Use the custom Next.js dep...
Deployment adapters on Next.js are now stable! This means that we don't have to stick to the limitations of sniffing out build outputs and manually moving or mo...
- NextJS builds sudden runtime_timeout
My builds suddenly stopped working. Activating old prebuilt snapshots work, but redeploying that same code produces builds that throw runtime_timeout FRA region