# Anyone used many WHERE filters in DELETE

**URL:** <https://forum.weaviate.io/t/anyone-used-many-where-filters-in-delete/4319>\
**Category:** Support\
**Created:** [September 25, 2024, 12:52pm UTC](https://forum.weaviate.io/t/anyone-used-many-where-filters-in-delete/4319 "2024-09-25T12:52:44Z")\
**Posts on this page:** 4\
**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 25, 2024, 12:52pm UTC](https://forum.weaviate.io/t/anyone-used-many-where-filters-in-delete/4319/1 "2024-09-25T12:52:44Z")

</div>

### Description

I looked at the support page for delete\_many but nowhere does it mention how to put multiple properties: [Delete objects | Weaviate Documentation](https://weaviate.io/developers/weaviate/manage-data/delete#use-containsany--containsall)

Is it even possible?

Can I delete all objects where property A = “Hello” and property B = “World”?

Here is the code I have so far, but it is throwing assertion error:

```auto
metadata = {
            "document_name": "my_document",
            "document_type": "xml",
            "source": "source1"
        }

filters = {
            "operator": "And",
            "operands": [
                {
                    "path": [key],
                    "operator": "Equal",
                    "valueString": value
                } for key, value in metadata.items()
            ]
        }
        print(filters)
        collection = self.__get_tenant_collection_object(self.collection_name, tenant_name)

        response = collection.data.delete_many(
            where=filters
        )

```

I want to delete all documents that have

```auto
            "document_name" = "my_document"
AND
            "document_type" = "xml"
AND
            "source" = "source1"

```

### Server Setup Information

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

---

<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 30, 2024, 6:27am UTC](https://forum.weaviate.io/t/anyone-used-many-where-filters-in-delete/4319/2 "2024-09-30T06:27:50Z")

</div>

@Shahin is this something you could assist with? It is a blocker for further development on Weaviate.

---

<div class="post-metadata">

**Author:** ![DudaNogueira](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/dudanogueira/32/7846_2.png) [@DudaNogueira](https://forum.weaviate.io/u/DudaNogueira)\
**Post date:** [October 1, 2024, 8:49am UTC](https://forum.weaviate.io/t/anyone-used-many-where-filters-in-delete/4319/3 "2024-10-01T08:49:52Z")

</div>

hi @Analitiq !

You can for sure do that.

This is how to do it using python v4 client:

```python
client.collections.delete("Test")
collection = client.collections.create(
    "Test",
    properties=[
        wvc.config.Property(
            name="text", data_type=wvc.config.DataType.TEXT
        )
    ]
)
collection.data.insert({"document_name": "my_document", "document_type": "xml", "source": "source1"})
collection.data.insert({"document_name": "my_document", "document_type": "xml", "source": "source2"})

```

We now have two objects:

```python
collection.aggregate.over_all()

```

> AggregateReturn(properties={}, total\_count=2)

Now we delete:

```python
collection.data.delete_many(
    where=(
        wvc.query.Filter.by_property("document_name").equal("my_document") &
        wvc.query.Filter.by_property("document_type").equal("xml") &
        wvc.query.Filter.by_property("source").equal("source1")
    )
)

```

If we now check the total count, we get:

> AggregateReturn(properties={}, total\_count=1)

---

<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:** [October 1, 2024, 9:05am UTC](https://forum.weaviate.io/t/anyone-used-many-where-filters-in-delete/4319/4 "2024-10-01T09:05:48Z")

</div>

@Analitiq I was about to confirm that with you, but @DudaNogueira was faster! Thank you so much, @DudaNogueira.

Also, adding to Duda’s response, I would recommend you always refer to the Python client to learn more about available features. For example, in relation to deletion, you can check this out: [Python Client Test Collection Filter](https://github.com/weaviate/weaviate-python-client/blob/main/integration/test_collection_filter.py#L147).
