
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
- cors error
my website is working and logged me in and sign also in the local host , but when i deployed it and then used it in the login and signup, it shows failed to fet...
- Unable to access certain projects after ...
As attached, after upgrading to pro and relogin to the appwrite console, for certain projects I am met with the 401 error although I am the owner of the organiz...
- Database update issue
When updating value of any attribute from appwrite Dashboard then this issue facing
