diff --git a/src/core/server/saved_objects/types.ts b/src/core/server/saved_objects/types.ts index 91bf2b5d64fad..a2cf8c5a593ee 100644 --- a/src/core/server/saved_objects/types.ts +++ b/src/core/server/saved_objects/types.ts @@ -109,6 +109,13 @@ export interface SavedObjectsFindOptions { */ defaultSearchOperator?: 'AND' | 'OR'; filter?: string | KueryNode; + /** + * Specify an Elasticsearch aggregation to perform. This alpha API only supports a limited set of aggregation types: metrics, bucket. Additional aggregation types can be contributed to Core. + * @alpha + * @example + * aggs = { type_count: { max: { field: 'dashboard.attributes.version' } } }; + * SavedObjects.find({type: 'dashboard', aggs: '%7B%22type_count%22%3A%7B%22max%22%3A%7B%22field%22%3A%22dashboard.attributes.version%22%7D%7D%7D'}) + */ aggs?: SavedObjectsAggs; namespaces?: string[]; /**