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.

This is done with the help of the `after` operator, also called the [cursor API](../apis/graphql-additional-operators.md#cursor-with-after).

:::callout{intent="info" title="Iterator"}
Some clients, such as the Python client, encapsulate this functionality as an `Iterator`.
:::

## Read object properties and ids

The following code iterates through all objects, providing the properties and id for each object.

:::code-group{sync="languages"}
```python title="Python" {3}
collection = client.collections.use("WineReview")

for item in collection.iterator():
    print(item.uuid, item.properties)
```

```typescript title="JavaScript/TypeScript"
const myCollection = client.collections.use("WineReview");

for await (let item of myCollection.iterator()) {
  console.log(item.uuid, item.properties);
}
```

```go title="Go" {27-28}
sourceClient, err := weaviate.NewClient(weaviate.Config{
  Scheme: "https",
  Host:   "WEAVIATE_INSTANCE_URL", // Replace WEAVIATE_INSTANCE_URL with your instance URL
  AuthConfig: auth.ApiKey{
    Value: "YOUR-WEAVIATE-API-KEY", // If auth enabled. Replace with your Weaviate instance API key.
  },
})
if err != nil {
  // handle error
  panic(err)
}

batchSize := 20
className := "WineReview"
classProperties := []string{"title"}

getBatchWithCursor := func(client weaviate.Client,
  className string, classProperties []string, batchSize int, cursor string) (*models.GraphQLResponse, error) {
  fields := []graphql.Field{}
  for _, prop := range classProperties {
    fields = append(fields, graphql.Field{Name: prop})
  }
  fields = append(fields, graphql.Field{Name: "_additional { id vector }"})

  get := client.GraphQL().Get().
    WithClassName(className).
    // Optionally retrieve the vector embedding by adding `vector` to the _additional fields
    WithFields(fields...).
    WithLimit(batchSize)

  if cursor != "" {
    return get.WithAfter(cursor).Do(context.Background())
  }
  return get.Do(context.Background())
}
```

```java title="Java" {4}
CollectionHandle<Map<String, Object>> collection =
    client.collections.use("WineReview");

for (WeaviateObject<Map<String, Object>> item : collection.paginate()) {
  System.out.printf("%s %s\n", item.uuid(), item.properties());
}
```

```csharp title="C#" {3-4}
var collection = client.Collections.Use("WineReview");

await foreach (var item in collection.Iterator())
{
    Console.WriteLine($"{item.UUID} {JsonSerializer.Serialize(item.Properties)}");
}
```
:::

:::callout{intent="info" title="Returned properties"}
By default, all properties and object UUIDs are returned. Blob and reference properties are excluded [unless specified otherwise](../how-to-query-search/basics.md#retrieve-object-properties). _This does not apply to the Go client library._
:::

## Read all objects including vectors

Read through all data including the vectors. (Also applicable where [named vectors](../reference-configuration/collections.md#multiple-vector-embeddings-named-vectors) are used.)

:::code-group{sync="languages"}
```python title="Python" {4,7}
collection = client.collections.use("WineReview")

for item in collection.iterator(
    include_vector=True  # If using named vectors, you can specify ones to include e.g. ['title', 'body'], or True to include all
):
    print(item.properties)
    print(item.vector)
```

```typescript title="JavaScript/TypeScript"
const myCollection = client.collections.use("WineReview");

for await (let item of myCollection.iterator({
    includeVector: true
  })) {
    console.log(item.uuid, item.properties);
    console.log(item.vectors);
}
```

```java title="Java" {5,8}
CollectionHandle<Map<String, Object>> collection =
    client.collections.use("WineReview");

for (WeaviateObject<Map<String, Object>> item : collection.paginate(
    i -> i.returnMetadata() // If using named vectors, you can specify ones to include
)) {
  System.out.println(item.properties());
  System.out.println(item.vectors());
}
```

```csharp title="C#" {5-7,10}
var collection = client.Collections.Use("WineReview");

await foreach (
    var item in collection.Iterator(
        includeVectors: true // If using named vectors, you can specify ones to include
    )
)
{
    Console.WriteLine(JsonSerializer.Serialize(item.Properties));
    Console.WriteLine(JsonSerializer.Serialize(item.Vectors));
}
```
:::

## Read all objects - Multi-tenant collections

Iterate through all tenants and read data for each.

:::callout{intent="tip" title="Multi-tenancy"}
For classes where [multi-tenancy](../concepts/data.md#multi-tenancy) is enabled, you need to specify the tenant name when reading or creating objects. See [Manage data: multi-tenancy operations](../how-to-manage-collections/multi-tenancy.md) for details.
:::

:::code-group{sync="languages"}
```python title="Python" {4,9}
multi_collection = client.collections.use("WineReviewMT")

# Get a list of tenants
tenants = multi_collection.tenants.get()

# Iterate through tenants
for tenant_name in tenants.keys():
    # Iterate through objects within each tenant
    for item in multi_collection.with_tenant(tenant_name).iterator():
        print(f"{tenant_name}: {item.properties}")
```

```typescript title="JavaScript/TypeScript"
const multiCollection = client.collections.use("WineReviewMT");

const tenants = await multiCollection.tenants.get()

for (let tenantName in tenants) {
  for await (let item of multiCollection.withTenant(tenantName).iterator()) {
    console.log(`${tenantName}:`, item.properties);
  }
}
```

```java title="Java" {5,10-12}
CollectionHandle<Map<String, Object>> multiCollection =
    client.collections.use("WineReviewMT");

// Get a list of tenants
var tenants = multiCollection.tenants.get();

// Iterate through tenants
for (Tenant tenant : tenants) {
  // Iterate through objects within each tenant
  for (WeaviateObject<Map<String, Object>> item : multiCollection
      .withTenant(tenant.name())
      .paginate()) {
    System.out.printf("%s: %s\n", tenant.name(), item.properties());
  }
}
```

```csharp title="C#" {4,10-12}
var multiCollection = client.Collections.Use("WineReviewMT");

// Get a list of tenants
var tenants = await multiCollection.Tenants.List();

// Iterate through tenants
foreach (var tenant in tenants)
{
    // Iterate through objects within each tenant
    var tenantCollection = multiCollection.WithTenant(tenant.Name);
    await foreach (var item in tenantCollection.Iterator())
    {
        Console.WriteLine($"{tenant.Name}: {JsonSerializer.Serialize(item.Properties)}");
    }
}
```
:::

## Related pages

- [Connect to Weaviate](../connect-to-weaviate/index.md)
- [How-to: Read objects](read.md)
- [References: GraphQL - Additional Operators](../apis/graphql-additional-operators.md#cursor-with-after)
- [Manage data: multi-tenancy operations](../how-to-manage-collections/multi-tenancy.md)

## Questions and feedback

Have a question or feedback? Here's how to reach us.

::::card-grid
:::card{title="Community Forum" href="https://forum.weaviate.io/c/support" icon="messages-square"}
Ask questions and connect with other developers on our **Community forum**.
:::

:::card{title="Support" href="/guides/support-overview" icon="life-buoy"}
Weaviate Cloud user or customer? Find the right channel on the **Support page**.
:::
::::

## Related pages

- [Agents](./agents-index.md)
- [AI-assisted Weaviate code generation](./ai-assisted-vibe-coding-index.md)
- [APIs](./apis-index.md)
- [Authorization and authentication](./authorization-and-authentication-index.md)
- [Benchmarks](./benchmarks-index.md)
- [Best practices](./best-practices-index.md)
- [Client libraries](./clients-index.md)
- [Client Libraries / SDKs](./client-libraries-index.md)
- [Cloud](./cloud-index.md)
- [Cloud account management](./cloud-account-management-index.md)

# Agent Instructions

This portal answers questions programmatically. To receive a synthesized,
source-cited answer instead of crawling page by page, append the `?ask=`
query parameter to any page URL on this site:

    /guides/quickstart?ask=how+do+I+authenticate

Optional parameters:

- `&goal=<what-you-are-trying-to-do>` steers the answer toward your
  objective (e.g. `&goal=write+a+python+client`).
- `&version=<label>` scopes the answer to a mounted version when the
  portal publishes more than one.

The response is `text/markdown`: the answer followed by a `# Sources` list
of the portal pages it was grounded in. Status codes are the contract:

- `200` — the answer; `402` — the portal owner’s plan or answer credits are
  exhausted (surface this to your operator; do NOT retry); `429` — you are
  rate-limited; back off for the `Retry-After` seconds; `503` — the answer
  lane is temporarily unavailable; fall back to crawling the `.md` pages.

For the full corpus map read `llms.txt` at the site root; for the tool
surface (search + page fetch as MCP tools) see `/mcp`.
