mirror of
https://github.com/directus/directus.git
synced 2026-01-30 23:58:15 -05:00
Add new aggregation types to query type
This commit is contained in:
@@ -10,6 +10,8 @@ export type Query = {
|
||||
meta?: Meta[];
|
||||
search?: string;
|
||||
export?: 'json' | 'csv' | 'xml';
|
||||
group?: string[];
|
||||
aggregate?: Aggregate;
|
||||
deep?: Record<string, Query>;
|
||||
};
|
||||
|
||||
@@ -22,6 +24,27 @@ export type Filter = {
|
||||
[keyOrOperator: string]: Filter | any;
|
||||
};
|
||||
|
||||
/**
|
||||
* Aggregate operation. Contains column name, and the field alias it should be returned as
|
||||
*/
|
||||
export type Aggregate = {
|
||||
avg?: {
|
||||
[column: string]: string;
|
||||
};
|
||||
min?: {
|
||||
[column: string]: string;
|
||||
};
|
||||
max?: {
|
||||
[column: string]: string;
|
||||
};
|
||||
count?: {
|
||||
[column: string]: string;
|
||||
};
|
||||
sum?: {
|
||||
[column: string]: string;
|
||||
};
|
||||
};
|
||||
|
||||
export type FilterOperator =
|
||||
| 'eq'
|
||||
| 'neq'
|
||||
|
||||
Reference in New Issue
Block a user