Back

What would be the best way to fetch the 5 latest/recent documents from the database?

  • 1
  • Databases
  • Web
Meli
10 Dec, 2023, 15:09

What would be the best way to fetch the 5 latest/recent documents from the database?

Right now I'm ordering them by date but it requires fetching all the documents from the clients browser, and then ordering them by date. Kind of complicaed and bloated 😦

TL;DR
The user is asking for the best way to fetch the 5 latest documents from the database. Currently, they are ordering the documents by date but it requires fetching all the documents from the client's browser and then ordering them. This is complicated and bloated. The suggested solution is to pass queries to order by date and limit to 5.
Drake
10 Dec, 2023, 15:23

You can pass queries to order by date and limit to 5. See https://appwrite.io/docs/queries

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