Skip to content

Latest commit

 

History

History
38 lines (29 loc) · 3.39 KB

File metadata and controls

38 lines (29 loc) · 3.39 KB

ObjectAggregationRequest

Aggregation request for bucket objects. Extends the base AggregationRequest with object-specific context. Inherits all fields from AggregationRequest. Requirements: - group_by: REQUIRED, fields to group by - aggregations: REQUIRED, aggregation operations to perform - All other fields from AggregationRequest are available Examples: - Count objects by status - Daily upload statistics - Category-based analytics with filtering

Properties

Name Type Description Notes
group_by List[GroupByField] Fields to group results by. REQUIRED, at least one field. Can include field transformations (date_trunc, date_part). Results will have one row per unique combination of group_by values.
aggregations List[AggregationOperation] Aggregation operations to perform. REQUIRED, at least one operation. Each operation produces a calculated field in results. Can combine multiple functions (COUNT, SUM, AVG, etc.).
filters Dict[str, object] Pre-aggregation filters to apply to source data. OPTIONAL, filters data before grouping. Uses same syntax as standard query filters. Applied before GROUP BY. [optional]
having List[HavingCondition] Post-aggregation filters to apply to results. OPTIONAL, filters groups after aggregation. Uses aggregation aliases as field names. Applied after GROUP BY and aggregation calculations. [optional]
unwind str Array field to unwind before aggregation. OPTIONAL, creates one document per array element. Useful for aggregating over array contents. Example: 'blobs' to analyze each blob separately. [optional]
range_buckets List[RangeBucket] Range-based bucketing for numeric fields. OPTIONAL, creates histogram-style buckets. Groups numeric values into defined ranges. Applied during grouping stage. [optional]
sort_by str Field to sort results by. OPTIONAL, can be group_by field or aggregation alias. Defaults to no specific order. Use with sort_direction to control order. [optional]
sort_direction str Sort direction. OPTIONAL, defaults to 'desc' (descending). Valid values: 'asc' (ascending), 'desc' (descending). Used with sort_by field. [optional] [default to 'desc']
limit int Maximum number of results to return. OPTIONAL, no limit if not specified. Applied after sorting. Useful for 'top N' queries. [optional]

Example

from mixpeek.models.object_aggregation_request import ObjectAggregationRequest

# TODO update the JSON string below
json = "{}"
# create an instance of ObjectAggregationRequest from a JSON string
object_aggregation_request_instance = ObjectAggregationRequest.from_json(json)
# print the JSON string representation of the object
print(ObjectAggregationRequest.to_json())

# convert the object into a dict
object_aggregation_request_dict = object_aggregation_request_instance.to_dict()
# create an instance of ObjectAggregationRequest from a dict
object_aggregation_request_from_dict = ObjectAggregationRequest.from_dict(object_aggregation_request_dict)

[Back to Model list] [Back to API list] [Back to README]