module documentation

Aggregations.

Copyright 2017-2025, Voxel51, Inc.

Class Aggregation Abstract base class for all aggregations.
Class Bounds Computes the bounds of a numeric field of a collection.
Class Count Counts the number of field values in a collection.
Class CountValues Counts the occurrences of field values in a collection.
Class Distinct Computes the distinct values of a field in a collection.
Class FacetAggregations Efficiently computes a set of aggregations rooted at a common path using faceted computations.
Class HistogramValues Computes a histogram of the field values in a collection.
Class ListSchema Extracts the value type(s) in a specified list field across all samples in a collection.
Class Max Computes the maximum of a numeric field of a collection.
Class Mean Computes the arithmetic mean of the field values of a collection.
Class Min Computes the minimum of a numeric field of a collection.
Class Quantiles Computes the quantile(s) of the field values of a collection.
Class Schema Extracts the names and types of the attributes of a specified embedded document field across all samples in a collection.
Class Std Computes the standard deviation of the field values of a collection.
Class Sum Computes the sum of the field values of a collection.
Class Values Extracts the values of the field from all samples in a collection.
Exception AggregationError An error raised during the execution of an Aggregation.
Variable logger Undocumented
Class _AggregationRepr Undocumented
Function _extract_list_values Undocumented
Function _extract_prefix_from_expr Undocumented
Function _find_prefixes Undocumented
Function _get_common_prefix Undocumented
Function _get_field_type Undocumented
Function _handle_dates Undocumented
Function _handle_reduce_unwinds Undocumented
Function _make_extract_values_pipeline Undocumented
Function _parse_field_and_expr Undocumented
Function _remove_prefix Undocumented
Function _replace_list Undocumented
Function _resolve_types Undocumented
Function _serialize_aggregation Undocumented
Function _to_safe_expr Undocumented
Function _transform_values Undocumented
Constant _MONGO_TO_FIFTYONE_TYPES Undocumented
Variable _repr Undocumented

Undocumented

def _extract_list_values(subfield, expr): (source)

Undocumented

def _extract_prefix_from_expr(expr): (source)

Undocumented

def _find_prefixes(expr, prefixes): (source)

Undocumented

def _get_common_prefix(prefixes): (source)

Undocumented

def _get_field_type(sample_collection, field_name, unwind=True): (source)

Undocumented

def _handle_dates(arg): (source)

Undocumented

def _handle_reduce_unwinds(path, unwind_list_fields, other_list_fields): (source)

Undocumented

def _make_extract_values_pipeline(path, list_fields, id_to_str, missing_value, big_result, big_field): (source)

Undocumented

def _parse_field_and_expr(sample_collection, field_name, expr=None, safe=False, unwind=True, allow_missing=False, context=None): (source)

Undocumented

def _remove_prefix(expr, prefix): (source)

Undocumented

def _replace_list(path, list_fields, old, new): (source)

Undocumented

def _resolve_types(raw_types): (source)

Undocumented

def _serialize_aggregation(agg_or_dict, include_uuid=True): (source)

Undocumented

def _to_safe_expr(expr, field_type): (source)

Undocumented

def _transform_values(values, fcn, level=1): (source)

Undocumented

_MONGO_TO_FIFTYONE_TYPES = (source)

Undocumented

Value
{'string': fof.StringField,
 'bool': fof.BooleanField,
 'int': fof.IntField,
 'long': fof.IntField,
 'date': fof.DateTimeField,
 'double': fof.FloatField,
 'decimal': fof.FloatField,
...

Undocumented