Aggregate Asset Unique Properties

async AsyncCogniteClient.assets.aggregate_unique_properties(
path: AssetProperty | str | list[str],
advanced_filter: Filter | dict[str, Any] | None = None,
aggregate_filter: AggregationFilter | dict[str, Any] | None = None,
filter: AssetFilter | dict[str, Any] | None = None,
) UniqueResultList

Get unique paths with counts for assets.

Note

In the case of text fields, the values are aggregated in a case-insensitive manner.

Parameters:
  • path (AssetPropertyLike) – The scope in every document to aggregate properties. The only value allowed now is [“metadata”]. It means to aggregate only metadata properties (aka keys).

  • advanced_filter (Filter | dict[str, Any] | None) – The advanced filter to narrow down assets.

  • aggregate_filter (AggregationFilter | dict[str, Any] | None) – The filter to apply to the resulting buckets.

  • filter (AssetFilter | dict[str, Any] | None) – The filter to narrow down assets (strict matching).

Returns:

List of unique values of assets matching the specified filters and search.

Return type:

UniqueResultList

Examples

Get the metadata keys with counts for your assets in your CDF project:

>>> from cognite.client import CogniteClient
>>> from cognite.client.data_classes.assets import AssetProperty
>>> client = CogniteClient()
>>> # async_client = AsyncCogniteClient()  # another option
>>> result = client.assets.aggregate_unique_properties(AssetProperty.metadata)