The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend theAggregateFieldclass.
Properties
aggregateType
readonlyaggregateType:AggregateType;
type
readonlytype="AggregateField";
A type string to uniquely identify instances of this class.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[],[],null,["# Class AggregateField (7.11.0)\n\nVersion latestkeyboard_arrow_down\n\n- [7.11.0 (latest)](/nodejs/docs/reference/firestore/latest/firestore/aggregatefield)\n- [7.9.0](/nodejs/docs/reference/firestore/7.9.0/firestore/aggregatefield)\n- [7.7.0](/nodejs/docs/reference/firestore/7.7.0/firestore/aggregatefield)\n- [7.6.0](/nodejs/docs/reference/firestore/7.6.0/firestore/aggregatefield)\n- [7.5.0](/nodejs/docs/reference/firestore/7.5.0/firestore/aggregatefield)\n- [7.4.0](/nodejs/docs/reference/firestore/7.4.0/firestore/aggregatefield)\n- [7.3.1](/nodejs/docs/reference/firestore/7.3.1/firestore/aggregatefield)\n- [7.2.0](/nodejs/docs/reference/firestore/7.2.0/firestore/aggregatefield)\n- [7.1.0](/nodejs/docs/reference/firestore/7.1.0/firestore/aggregatefield)\n- [6.4.1](/nodejs/docs/reference/firestore/6.4.1/firestore/aggregatefield)\n- [6.3.0](/nodejs/docs/reference/firestore/6.3.0/firestore/aggregatefield)\n- [6.0.0](/nodejs/docs/reference/firestore/6.0.0/firestore/aggregatefield)\n- [5.0.2](/nodejs/docs/reference/firestore/5.0.2/firestore/aggregatefield)\n- [4.15.1](/nodejs/docs/reference/firestore/4.15.1/firestore/aggregatefield)\n- [4.14.2](/nodejs/docs/reference/firestore/4.14.2/firestore/aggregatefield)\n- [4.9.8](/nodejs/docs/reference/firestore/4.9.8/firestore/aggregatefield) \nRepresents an aggregation that can be performed by Firestore.\n\nPackage\n-------\n\n[@google-cloud/firestore](../overview.html)\n\nRemarks\n-------\n\nThe constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the `AggregateField` class.\n\nProperties\n----------\n\n### aggregateType\n\n readonly aggregateType: AggregateType;\n\n### type\n\n readonly type = \"AggregateField\";\n\nA type string to uniquely identify instances of this class.\n\nMethods\n-------\n\n### average(field)\n\n static average(field: string | FieldPath): AggregateField\u003cnumber | null\u003e;\n\nCreate an AggregateField object that can be used to compute the average of a specified field over a range of documents in the result set of a query.\n\n### count()\n\n static count(): AggregateField\u003cnumber\u003e;\n\nCreate an AggregateField object that can be used to compute the count of documents in the result set of a query.\n\n### isEqual(other)\n\n isEqual(other: AggregateField\u003cT\u003e): boolean;\n\nCompares this object with the given object for equality.\n\nThis object is considered \"equal\" to the other object if and only if `other` performs the same kind of aggregation on the same field (if any).\n\n### sum(field)\n\n static sum(field: string | FieldPath): AggregateField\u003cnumber\u003e;\n\nCreate an AggregateField object that can be used to compute the sum of a specified field over a range of documents in the result set of a query."]]