Back

[SOLVED] Appwrite Query Help with $createdAt property

  • 0
  • Web
Shubham
3 Oct, 2023, 12:46

I want to show specific month with year data according to $ceatedAt property , i am unable to do it , how will i do this ?

TL;DR
User is having trouble with an Appwrite query involving the $createdAt property. They posted their code which included a limit, order, greater than, and not equal operators. They are specifically asking how to filter data based on a specific month and year using the $createdAt property. Another user suggests converting the date to an ISO 8601 string in UTC before executing the code. The original user responds that their code now works after making the suggested changes. Solution: The user needed to format the date as an ISO 8601 string in UTC before executing the query.
Shubham
3 Oct, 2023, 12:46
TypeScript
      databaseID,
      collectionId,
      [
        Query.limit(50),
        Query.orderDesc("$createdAt"),
        Query.greaterThan("$createdAt",date).
        Query.notEqual("status","failed"), 
     ]
    );```
Shubham
3 Oct, 2023, 12:47

this code i have written , but its not working at all

Drake
3 Oct, 2023, 13:46

Did you format date as an iso 8601 string in UTC?

Shubham
3 Oct, 2023, 15:40

After converting , my code works , thanks

safwan
3 Oct, 2023, 16:03

[SOLVED] Appwrite Query Help with $createdAt property

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more