FQL v4 will be decommissioned on June 30, 2025. Ensure that you complete your migration from FQL v4 to FQL v10 by that date. Fauna accounts created after August 21, 2024 must use FQL v10. These accounts will not be able to run FQL v4 queries or access the v4 Dashboard. For more details, see the v4 EOL announcement and migration guide. Contact support@fauna.com with any questions. |
Sum
This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics. |
Sum( arrayOrSet )
sum( arrayOrSet )
Sum( arrayOrSet )
Sum( arrayOrSet )
Sum( arrayOrSet )
Sum( arrayOrSet )
Description
The Sum
function returns the sum of all items in arrayOrSet
,
which is an Array, Page, or Set.
The run time of For query "width" errors, the underlying set or page involves more than
100K items. This can happen when using a set function, such as
For example, instead of:
use:
This does mean that if the entire set must be evaluated to arrive at the
correct result, you would have to page through the For query timeout errors, you may specify a larger query timeout via the driver that you are using. |
Parameters
Parameter | Type | Definition and Requirements |
---|---|---|
|
Array, Page, or Set |
The Array, Page, or Set that should have its items summed. |
Examples
The following query returns the sum of items in the provided array:
55
55
55
LongV(55)
55
55
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!