Back

Appwrite Query (SUM, GROUP)

  • 0
  • Tools
  • Self Hosted
Yasin E.
12 Jul, 2023, 10:28

Extra features such as sum and group are needed for Appwrite Query. Is there a plan for this or could these features come in future versions?

Or how can I solve these problems like creating a view in the database?

TL;DR
Unfortunately, the current version of Appwrite Query does not support features such as 'sum' and 'group'. However, there are a couple of workarounds that you can try. One option is to write a function that runs periodically and paginates over all the documents to get an exact count. Another option is to use the 'sum()' function from the listDocuments method, although it is capped at 5000. While there is no definite timeline for when new queries will be introduced, you can leave your thoughts and suggestions on the Appwrite GitHub discussion page provided in the thread. Creating a view in the database is not
joeyouss
12 Jul, 2023, 13:26

Hi,

joeyouss
12 Jul, 2023, 13:39

You might want to see this https://github.com/appwrite/appwrite/discussions/3545 It is hard to say the exact time when we introduce new queries but you can leave your thoughts here.

joeyouss
12 Jul, 2023, 13:45

For now you can use sum() from listDocuments, which is capped at 5000.

joeyouss
12 Jul, 2023, 13:46

If you need exact count, you can write a function that runs every t minutes, and it paginates over all the documents. That will give you exact count.

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