Skip to content

πŸ”₯ πŸ”₯ πŸ”₯ A Free & Self-hostable Airtable Alternative

add aggregation property to fields

Fendy Heryanto8acbc1a68811
diff --git a/packages/nocodb/src/schema/swagger-v3.json b/packages/nocodb/src/schema/swagger-v3.json
index e513d05544..9348c4f683 100644
--- a/packages/nocodb/src/schema/swagger-v3.json
+++ b/packages/nocodb/src/schema/swagger-v3.json
@@ -5221,6 +5221,35 @@
}
}
},
+ "ViewAggregationEnum": {
+ "type": "string",
+ "enum": [
+ "sum",
+ "min",
+ "max",
+ "avg",
+ "median",
+ "std_dev",
+ "range",
+ "count",
+ "count_empty",
+ "count_filled",
+ "count_unique",
+ "percent_empty",
+ "percent_filled",
+ "percent_unique",
+ "none",
+ "attachment_size",
+ "checked",
+ "unchecked",
+ "percent_checked",
+ "percent_unchecked",
+ "earliest_date",
+ "latest_date",
+ "date_range",
+ "month_range"
+ ]
+ },
"ViewBase": {
"type": "object",
"properties": {
@@ -5442,6 +5471,9 @@
},
"width": {
"type": "integer"
+ },
+ "aggregation": {
+ "$ref": "#/components/schemas/ViewAggregationEnum"
}
},
"required": [
diff --git a/packages/nocodb/src/utils/api-v3-data-transformation.builder.ts b/packages/nocodb/src/utils/api-v3-data-transformation.builder.ts
index 9c54fe376f..0d04c104a2 100644
--- a/packages/nocodb/src/utils/api-v3-data-transformation.builder.ts
+++ b/packages/nocodb/src/utils/api-v3-data-transformation.builder.ts
@@ -801,6 +801,7 @@ export const viewColumnBuilder = builderGenerator<
'help',
'description',
'required',
+ 'aggregation',
],
mappings: {
fk_column_id: 'field_id',