Back

Randomising Queries

  • 0
  • Self Hosted
  • Flutter
  • Databases
  • General
frankenstein
25 Apr, 2024, 08:52

Is there a way to randomise a query from from a collection of posts or products. So that each query is different. Just like top e commerce sites like temu, aliexpress, each time you refresh the recommended products are not the same and in different order

TL;DR
Developers want to know how to randomize queries from a collection of posts or products so that each query is different, similar to top e-commerce sites like Temu and AliExpress. This way, each time a user refreshes the recommended products, they will see a new order. Solution: Implement a random function in the query to shuffle the results each time the query is run.
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