ArangoDB sum by groups

I have little problem with ArangoDB query. In postgres i did it quick and with no problems:

SELECT SUM(x) from table GROUP BY
  case
   when age < 18 then 'Under 18'
   when age between 18 and 24 then '18-24'
   when age between 25 and 67 then '25-67'
   when age between 68 and 100 then '68-100'
 END

I want to compare time for this execution in postgres and arango but... i have no idea how it should look like in arango.

There's posibility to create few group (FILTER + COLLECT AGGREGATE s = SUM(set return from FILTER)) in one LOOP? Any ideas?

Tags ArangoDB
Đã hỏi - admin
16 ngày 5 giờ