# \[Question\] Running Aggregate against Weaviate Cloud

**URL:** <https://forum.weaviate.io/t/question-running-aggregate-against-weaviate-cloud/4258>\
**Category:** Support\
**Created:** [September 23, 2024, 10:59am UTC](https://forum.weaviate.io/t/question-running-aggregate-against-weaviate-cloud/4258 "2024-09-23T10:59:40Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Analitiq](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@Analitiq](https://forum.weaviate.io/u/Analitiq)\
**Post date:** [September 23, 2024, 10:59am UTC](https://forum.weaviate.io/t/question-running-aggregate-against-weaviate-cloud/4258/1 "2024-09-23T10:59:40Z")

</div>

### Description

I keep getting an error when trying to run a query against the Weavaite cloud:  
`AttributeError: '_QueryCollection' object has no attribute 'aggregate'`  
I am lost as to what could be causing it as I have checked the documentation and done all the updates I could.

The code that I am running:

```auto
# Establish a connection to Weaviate Cloud
client = weaviate.connect_to_weaviate_cloud(
    cluster_url="",
    auth_credentials=weaviate.AuthApiKey(api_key="")
)

collection = client.collections.get("Test")

# Get collection specific to the required tenant
multi_tenants = collection.with_tenant("test")

multi_tenants.query.aggregate("Test") \
    .with_where({
    "path": ["document_name"],
    "operator": "Equal",
    "valueString": "document1"
}) \
    .with_tenant(tenant_id) \
    .with_fields("date_loaded { minimum maximum }") \
    .do()

```

### Server Setup Information

- Weaviate Server Version: Weaviate Cloud
- Deployment Method:
- Multi Node? Number of Running Nodes:
- Client Language and Version: Python 3.11, Weaviate v.4.8.1
- Multitenancy

### Any additional Information

---

<div class="post-metadata">

**Author:** ![Shahin](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/shahin/32/7944_2.png) [@Shahin](https://forum.weaviate.io/u/Shahin)\
**Post date:** [September 23, 2024, 2:22pm UTC](https://forum.weaviate.io/t/question-running-aggregate-against-weaviate-cloud/4258/2 "2024-09-23T14:22:39Z")

</div>

Hello @Analitiq,

Welcome to our community! It’s lovely having you here.

You can aggregate with a condition as shown below:

> **[Aggregate data | Weaviate](https://weaviate.io/developers/weaviate/search/aggregate#filter-results)**
>
> Aggregate queries process the result set to return calculated results. Use aggregate queries for groups of objects or the entire result set.

Could you please provide me your cluster endpoint? I will try to replicate and show you the method to aggregate.

I recommend you to update your client and weaviate db to the latest version as client v3 will be deprecated very soon.

Also, I see you’re on Weaviate Cloud. Feel free to email us at [support@weaviate.io](mailto:support@weaviate.io), which will create a support ticket in our system for our paid customers.

Have a lovely week!

---

<div class="post-metadata">

**Author:** ![Analitiq](https://avatars.discourse-cdn.com/v4/letter/a/ba9def/32.png) [@Analitiq](https://forum.weaviate.io/u/Analitiq)\
**Post date:** [September 25, 2024, 12:38pm UTC](https://forum.weaviate.io/t/question-running-aggregate-against-weaviate-cloud/4258/3 "2024-09-25T12:38:10Z")

</div>

I have solved this like this:  
response = collection.aggregate.over\_all(total\_count=True, filters=filters)
