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
- Clean install of 1.9.0 shows errors in a...
I just run a full clean install of Appwrite on my server following the Manual installation guide in the docs page. The console seems to work, visually there d...
- Setup custom domain on selfhosted behind...
Hello everyone, can anyone help me to setup a custom domain on a selfhosted appwrite instance thats running behind cloudflare tunnels? Current setup: Appwrite r...
- Why does this happen?
`AppwriteException: general_argument_invalid, Invalid `secret` param: Value must be a valid string and at least 1 chars and no longer than 256 chars (400)` the...