Aggregate files metadata
- async AsyncCogniteClient.files.aggregate_count(
- filter: FileMetadataFilter | dict[str, Any] | None = None,
-
Deprecated since version 8.23.0: The (asset-centric) Files metadata API is deprecated and is scheduled for removal on 2027-12-31. Create and query files as CogniteFile instances in the core data model (file content upload/download remain available via instance_id). See https://docs.cognite.com/cdf/deprecated for details and migration guidance.
- Parameters:
filter (FileMetadataFilter | dict[str, Any] | None) – Filter on file metadata filter with exact match
- Returns:
Count of files matching the filter.
- Return type:
int
Examples
Get the count of files that have been uploaded:
>>> from cognite.client import CogniteClient, AsyncCogniteClient >>> client = CogniteClient() >>> # async_client = AsyncCogniteClient() # another option >>> aggregate_uploaded = client.files.aggregate_count(filter={"uploaded": True})