# I want to delete a file from my database. I put every file in smaller chunks without id i think. (cannot find the id). I thought i could deleted every chunk if a word is in it. But i dont know what i did wrong

**URL:** <https://forum.weaviate.io/t/i-want-to-delete-a-file-from-my-database-i-put-every-file-in-smaller-chunks-without-id-i-think-cannot-find-the-id-i-thought-i-could-deleted-every-chunk-if-a-word-is-in-it-but-i-dont-know-what-i-did-wrong/2704>\
**Category:** Support\
**Created:** [June 14, 2024, 11:29am UTC](https://forum.weaviate.io/t/i-want-to-delete-a-file-from-my-database-i-put-every-file-in-smaller-chunks-without-id-i-think-cannot-find-the-id-i-thought-i-could-deleted-every-chunk-if-a-word-is-in-it-but-i-dont-know-what-i-did-wrong/2704 "2024-06-14T11:29:51Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![jochem](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jochem](https://forum.weaviate.io/u/jochem)\
**Post date:** [June 14, 2024, 11:29am UTC](https://forum.weaviate.io/t/i-want-to-delete-a-file-from-my-database-i-put-every-file-in-smaller-chunks-without-id-i-think-cannot-find-the-id-i-thought-i-could-deleted-every-chunk-if-a-word-is-in-it-but-i-dont-know-what-i-did-wrong/2704/1 "2024-06-14T11:29:51Z")

</div>

The error

File “C:\Python\Python311\Lib\site-packages\weaviate\batch\crud\_batch.py”, line 1368, in delete\_objects  
res = \_decode\_json\_response\_dict(response, “Delete in batch”)  
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  
File “C:\Python\Python311\Lib\site-packages\weaviate\util.py”, line 798, in \_decode\_json\_response\_dict  
raise UnexpectedStatusCodeException(location, response)  
weaviate.exceptions.UnexpectedStatusCodeException: Delete in batch! Unexpected status code: 422, with response body: {‘error’: [{‘message’: “validate: invalid where filter: no such prop with name ‘filename’ found in class ‘Test’ in the schema. Check your schema files for which properties in this class are available”}]}.

the code:

import weaviate

client = weaviate.Client(  
url = “[http://10.0.128.34:8888](http://10.0.128.34:8888)”, # Replace with your endpoint  
)

client.batch.delete\_objects(  
class\_name=“Test”,  
where={  
“path”: [“filename”],  
“operator”: “Like”,  
“valueText”: “\*JochemW.pdf”  
},  
)

my code

---

<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:** [June 14, 2024, 2:34pm UTC](https://forum.weaviate.io/t/i-want-to-delete-a-file-from-my-database-i-put-every-file-in-smaller-chunks-without-id-i-think-cannot-find-the-id-i-thought-i-could-deleted-every-chunk-if-a-word-is-in-it-but-i-dont-know-what-i-did-wrong/2704/2 "2024-06-14T14:34:12Z")

</div>

hi @jochem !!

Not sure I understood 🤔

You find the object doing this search, but when you delete, it doesn’t get deleted?

Also, what is the version and deployment type.

Thanks!

---

<div class="post-metadata">

**Author:** ![jochem](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jochem](https://forum.weaviate.io/u/jochem)\
**Post date:** [June 21, 2024, 6:49am UTC](https://forum.weaviate.io/t/i-want-to-delete-a-file-from-my-database-i-put-every-file-in-smaller-chunks-without-id-i-think-cannot-find-the-id-i-thought-i-could-deleted-every-chunk-if-a-word-is-in-it-but-i-dont-know-what-i-did-wrong/2704/3 "2024-06-21T06:49:25Z")

</div>

hi @DudaNogueira,

I want to deleted some chunks out of my database. They all have one word in common. I want to deleted that kind of chunks. I dont have the object id of them so i want it to do it with a word. Is that possible?

---

<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:** [June 21, 2024, 2:41pm UTC](https://forum.weaviate.io/t/i-want-to-delete-a-file-from-my-database-i-put-every-file-in-smaller-chunks-without-id-i-think-cannot-find-the-id-i-thought-i-could-deleted-every-chunk-if-a-word-is-in-it-but-i-dont-know-what-i-did-wrong/2704/4 "2024-06-21T14:41:31Z")

</div>

Sure!

this is how, using python v4 latest client:

Just like you can search:

```auto
collection.query.fetch_objects(
    filters=Filter.by_property("text").contains_any(["car"])
).objects

```

you can also delete:

```auto
collection.data.delete_many(
    where=Filter.by_property("text").contains_any(["car"])
)

```

Let me know if this helps 🙂

---

<div class="post-metadata">

**Author:** ![jochem](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jochem](https://forum.weaviate.io/u/jochem)\
**Post date:** [June 24, 2024, 6:29am UTC](https://forum.weaviate.io/t/i-want-to-delete-a-file-from-my-database-i-put-every-file-in-smaller-chunks-without-id-i-think-cannot-find-the-id-i-thought-i-could-deleted-every-chunk-if-a-word-is-in-it-but-i-dont-know-what-i-did-wrong/2704/5 "2024-06-24T06:29:43Z")

</div>

Hii @DudaNogueira,

first i didnt tell you, but I have python client V3. My weaviate database version is 3.26.2.  
I also checked on weaviate the delete objects website. But i tried the delete multiple objects and the containsany.

---

<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:** [June 24, 2024, 6:03pm UTC](https://forum.weaviate.io/t/i-want-to-delete-a-file-from-my-database-i-put-every-file-in-smaller-chunks-without-id-i-think-cannot-find-the-id-i-thought-i-could-deleted-every-chunk-if-a-word-is-in-it-but-i-dont-know-what-i-did-wrong/2704/6 "2024-06-24T18:03:37Z")

</div>

Hi! Latest database version is 1.25.5.

3.26.2 is probably the client version 🙂

Can you check the server version?

We strongly recommend using pyv4 as it will leverage GRPC and deliver way more performance on reads and writes.

Were you able to use with pyv3 client?

Thanks!

---

<div class="post-metadata">

**Author:** ![jochem](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jochem](https://forum.weaviate.io/u/jochem)\
**Post date:** [June 26, 2024, 6:26am UTC](https://forum.weaviate.io/t/i-want-to-delete-a-file-from-my-database-i-put-every-file-in-smaller-chunks-without-id-i-think-cannot-find-the-id-i-thought-i-could-deleted-every-chunk-if-a-word-is-in-it-but-i-dont-know-what-i-did-wrong/2704/7 "2024-06-26T06:26:36Z")

</div>

Hi @DudaNogueira,

py4 is not a option in this project. my database version is actually 1.24.1.

Were you able to use with pyv3 client?

no.

---

<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:** [June 26, 2024, 12:29pm UTC](https://forum.weaviate.io/t/i-want-to-delete-a-file-from-my-database-i-put-every-file-in-smaller-chunks-without-id-i-think-cannot-find-the-id-i-thought-i-could-deleted-every-chunk-if-a-word-is-in-it-but-i-dont-know-what-i-did-wrong/2704/8 "2024-06-26T12:29:26Z")

</div>

hi @jochem !

You will need to figure out the name of the property. You are passing `filename` which doesn’t exist.

you can check the properties of your collections with:

```auto
import weaviate
clientv3 = weaviate.Client("http://localhost:8080")
for item in clientv3.schema.get().get("classes"):
    print(item["class"], [p["name"] for p in item["properties"]])

```

make sure the filename field is in the collection you are querying.

Thanks!

---

<div class="post-metadata">

**Author:** ![jochem](https://avatars.discourse-cdn.com/v4/letter/j/9dc877/32.png) [@jochem](https://forum.weaviate.io/u/jochem)\
**Post date:** [June 26, 2024, 1:01pm UTC](https://forum.weaviate.io/t/i-want-to-delete-a-file-from-my-database-i-put-every-file-in-smaller-chunks-without-id-i-think-cannot-find-the-id-i-thought-i-could-deleted-every-chunk-if-a-word-is-in-it-but-i-dont-know-what-i-did-wrong/2704/9 "2024-06-26T13:01:27Z")

</div>

Thank you i knew filename was wrong only i didnt knew what was right. It is something of your properties name there.
