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?
const date_time = "2024-11"; const batchs = await databases.listDocuments( process.env.APPWRITE_DATABASE_ID, process.env.APPWRITE_COLLECTION_ID, [ ? ] );
[SOLVED]
const startOfMonth = "${date_time}-01T00:00:00.000Z";
const endOfMonth = new Date("${date_time}-01T00:00:00.000Z");
endOfMonth.setMonth(endOfMonth.getMonth() + 1);
endOfMonth.setDate(0);
const endOfMonthISO = endOfMonth.toISOString();
query.push(sdk.Query.between('$createdAt', startOfMonth, endOfMonthISO));
Recommended threads
- Incorporate appwrite with spring boot
I am trying to upload files from a Spring boot app to appwrite. I've checked the SDK on maven but it seems to be for Android. Do I have to call Appwrite's REST ...
- User is not authorized to read collectio...
When i tried to make a read call to my db it always returns that my user is not authorized to perform such action am i doing something wrong?
- How to Ensure a User Can Only Access, Ad...
Hi everyone, I'm building an app using Appwrite, and I'm working on a feature where users can store their favorite items in a "Favorites" collection. Each favo...