Back

[SOLVED] Query all documents made a day

  • 0
  • Databases
D5
12 Aug, 2023, 17:14

I have some documents being created every day.

How I could get all the documents created based on the day?

TL;DR
Solution: To query all documents created on a specific day, you can use the `$createdAt` attribute and compare it with the desired date. For example, you can use the following query in TypeScript: `Query.startsWith("$createdAt", "2023-08-12")`. This will retrieve all documents created on August 12, 2023.
XaFigg
12 Aug, 2023, 17:21

Hi ! I think you can do like this:

Compare the beginning of the $createdAt attribute with today's date, for example:

TypeScript
Query.startsWith("$createdAt", "2023-08-12")
D5
12 Aug, 2023, 17:22

I've thought createdAt wasn't an attribute...

D5
12 Aug, 2023, 17:22

Will check, thanks

XaFigg
12 Aug, 2023, 17:22

Humm

XaFigg
12 Aug, 2023, 17:22
D5
12 Aug, 2023, 17:23

Seems yes, will try

D5
13 Aug, 2023, 11:38

@XaFigg Thanks, it works perfectly as supposed. Thanks again! :appwritepeepo:

D5
13 Aug, 2023, 11:38

[SOLVED] Query all documents made a day

XaFigg
13 Aug, 2023, 12:10

Perfect 😁

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