Reference documentation and code samples for the Firestore v1 API class StructuredAggregationQuery.Types.Aggregation.Types.Sum.
Sum of the values of the requested field.
Only numeric values will be aggregated. All non-numeric values
including NULL are skipped.
If the aggregated values contain NaN, returns NaN. Infinity math
follows IEEE-754 standards.
If the aggregated value set is empty, returns 0.
Returns a 64-bit integer if all aggregated numbers are integers and the
sum result does not overflow. Otherwise, the result is returned as a
double. Note that even if all the aggregated values are integers, the
result is returned as a double if it cannot fit within a 64-bit signed
integer. When this occurs, the returned value will lose precision.
When underflow occurs, floating-point aggregation is non-deterministic.
This means that running the same query repeatedly without any changes to
the underlying values could produce slightly different results each
time. In those cases, values should be stored as integers over
floating-point numbers.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[[["\u003cp\u003eThe document provides reference information for the \u003ccode\u003eStructuredAggregationQuery.Types.Aggregation.Types.Sum\u003c/code\u003e class in the Google Cloud Firestore v1 API, specifically within the .NET environment.\u003c/p\u003e\n"],["\u003cp\u003eThis class is designed to aggregate the sum of numeric values from a specified field, skipping any non-numeric or \u003ccode\u003eNULL\u003c/code\u003e values, with special handling for \u003ccode\u003eNaN\u003c/code\u003e and infinity values based on IEEE-754 standards.\u003c/p\u003e\n"],["\u003cp\u003eThe result of the aggregation can be a 64-bit integer if all values are integers and the sum doesn't overflow; otherwise, the result is a double, potentially losing precision in some cases, and underflow can lead to non-deterministic results.\u003c/p\u003e\n"],["\u003cp\u003eThe documentation includes a list of available versions, ranging from 2.3.0 to 3.10.0 (latest), for the \u003ccode\u003eStructuredAggregationQuery.Types.Aggregation.Types.Sum\u003c/code\u003e class, and also specifies the inheritance and implemented interfaces of the class, like IMessage, IEquatable, IDeepCloneable, and IBufferMessage.\u003c/p\u003e\n"],["\u003cp\u003eThe class provides constructor options to create an instance of \u003ccode\u003eSum\u003c/code\u003e, and offers the \u003ccode\u003eField\u003c/code\u003e property to specify which field will be aggregated, by using a \u003ccode\u003eFieldReference\u003c/code\u003e type.\u003c/p\u003e\n"]]],[],null,[]]