> ## Documentation Index
> Fetch the complete documentation index at: https://docs.topk.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Delete documents

You can delete documents by their `_id` or using a [filter expression](/documents/query#filtering). Both methods provide
the same consistency guarantees and will be reflected in query/get results according to your [consistency level](/concepts/consistency).

To delete documents by their `_id`, pass a list of `_id`s to the [`delete()`](/sdk/topk-py#delete) method:

<CodeGroup>
  ```python Python theme={null}
  client.collection("books").delete(
      ["book-1", "book-2", "book-3"]
  )
  ```

  ```typescript Javascript theme={null}
  await client.collection("books").delete(["book-1", "book-2", "book-3"]);
  ```
</CodeGroup>

<Info>
  The `delete()` method returns an **LSN** (Log Sequence Number) that you can pass to subsequent queries for [read-after-write consistency](/documents/query#lsn-based-consistency).
</Info>

## Delete documents by filter expression

To delete documents that match a predicate, you can pass a [filter expression](https://docs.topk.io/documents/query#filtering) to the `delete()` function.

<CodeGroup>
  ```python Python theme={null}
  from topk_sdk.query import field

  client.collection("books").delete(field("published_year").lt(1997))
  ```

  ```typescript Javascript theme={null}
  import { field } from "topk-js/query";

  await client.collection("books").delete(field("published_year").lt(1997));
  ```
</CodeGroup>

<Tip>
  Passing a filter expression to `delete()` is useful for deleting documents that match a specific condition, such as all documents for a **specific tenant** e.g. `field("_id").starts_with("tenant-123/")`.
</Tip>
