Skip to content
Back

How to get documents by date?

  • 0
  • Web
paulos
6 Dec, 2023, 10:35

fetch documents created today, this week, this month

TL;DR
To fetch documents based on date, you can use a query on the "created at" attribute in your database. You can find more information on how to use queries in the provided link. To implement filter options for users, such as "Past 24 hours," "This week," or "This month," you can modify your query based on the user's selection. For example, to fetch documents created in the past 24 hours, you would use a query that filters for documents where the "created at" attribute is greater than the current time minus 24 hours. Similarly, for "This week," you would use a query that
Drake
6 Dec, 2023, 11:21

Sorry, would you please provide more context/details?

paulos
6 Dec, 2023, 11:34

i want to fetch documents when a user clicks a filter option like if the user click's Past 24 hours i want to fetch documents created in the past 24 hours if the user click's This week i want to fetch documents that are created this week and if the user chooses this month i want to fetch documents that are created this month

Drake
6 Dec, 2023, 12:48

Use a query on the created at attribute:

https://appwrite.io/docs/products/databases/queries

Drake
6 Dec, 2023, 12:49

How to get documents by date?

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