# \[Question\] How to retrieve all documents in weaviate?

**URL:** <https://forum.weaviate.io/t/question-how-to-retrieve-all-documents-in-weaviate/3339>\
**Category:** Support\
**Created:** [August 13, 2024, 5:49am UTC](https://forum.weaviate.io/t/question-how-to-retrieve-all-documents-in-weaviate/3339 "2024-08-13T05:49:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![cyc00518](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/cyc00518/32/2117_2.png) [@cyc00518](https://forum.weaviate.io/u/cyc00518)\
**Post date:** [August 13, 2024, 5:49am UTC](https://forum.weaviate.io/t/question-how-to-retrieve-all-documents-in-weaviate/3339/1 "2024-08-13T05:49:30Z")

</div>

### Description

I want to get all documents in weaviate, but it always return just part of my query to me.  
For example,

```auto
client=weaviate.Client(weaviate_url) 
query = (
    client.query.get(class_name, ["content", "source", "idx"])
    .with_where({
        "path": ["source"],  
        "operator": "Equal",  
        "valueString": doc_name
    })
)

```

```auto
len(response['data']['Get'][class_name]) # 100

```

But it’s actually 450 documents. If I add `with_limit(2000)`, I can get right response.

```auto
client=weaviate.Client(weaviate_url) 
query = (
    client.query.get(class_name, ["content", "source", "idx"])
    .with_where({
        "path": ["source"],  
        "operator": "Equal",  
        "valueString": doc_name
    })
)
response = query.with_limit(2000).do()

```

```auto
len(response['data']['Get'][class_name]) # 450

```

But If real number of documents are larger than 2000, it will return wrong result for me.  
Would somebody can tell me how to deal with it?

Thanks!

### Server Setup Information

- Weaviate Server Version: 3.24.1

### Any additional Information

---

<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:** [August 13, 2024, 12:33pm UTC](https://forum.weaviate.io/t/question-how-to-retrieve-all-documents-in-weaviate/3339/2 "2024-08-13T12:33:49Z")

</div>

hi @cyc00518 !! Welcome to our community 🤗 !!

You can use our cursor api, as stated here:

> **[Read all objects | Weaviate - Vector Database](https://weaviate.io/developers/weaviate/manage-data/read-all-objects)**
>
> Weaviate provides the necessary APIs to iterate through all your data. This is useful when you want to manually copy/migrate your data (and vector embeddings) from one place to another.

Also, I noticed you are using our python client version 3.24.1.

We strongly suggest using the new python v4 client, as it will have significant performance improvements for read and write operations, as it will leverage GRPC instead REST/HTTP

Let me know if this helps or if there is any other help I can provide!

Thanks!

---

<div class="post-metadata">

**Author:** ![cyc00518](https://yyz1.discourse-cdn.com/flex027/user_avatar/forum.weaviate.io/cyc00518/32/2117_2.png) [@cyc00518](https://forum.weaviate.io/u/cyc00518)\
**Post date:** [August 14, 2024, 1:03am UTC](https://forum.weaviate.io/t/question-how-to-retrieve-all-documents-in-weaviate/3339/3 "2024-08-14T01:03:56Z")

</div>

Hi, @DudaNogueira!  
Thanks for your quick reply!

Sorry, I think I might lose that document on your guide page.

Honestly, I do really find that you release v4 version. But I build a knowledge platform in my company based on v3 version early last year. So it might took quite much time to transfer to new v4 version… 🫠

In fact, I still have one question, hope you don’t mind I ask in this page.

About my knowledge platform mentioned above, I should build a delete function for user to delete what they uploaded before. I use `with_where` to filter those data in weaviate , but I find  
`Equal` operator doesn’t return precise result for me.

For example, I want to filter `source == '請假.txt'`, but it will return `source == 請假.txt` and `source == 請假_53.txt`. So I need to add filter rule by myself.

```auto
import weaviate
class_name= 'TEST'
client=weaviate.Client(weaviate_url)
doc_name='請假.txt'     
response = (
    client.query.get(class_name, properties=["_additional {id}", "source"])
    .with_where({
        "path": ["source"],
        "operator": "Equal",
        "valueString": doc_name
    })  
).with_limit(20000).do()

source_set = set([item['source'] for item in response['data']['Get'][class_name]])
print(source_set)
# {'請假.txt', '請假_53.txt'} -> I hope it should only be '請假.txt'

```

Is it a right behavior for `Equal` operator ? Or it is some bug for `Chinese` file\_name?

Thanks!!
