# Delete

The delete method allows you to delete vectors from your index using various criteria. You can delete vectors by their IDs, by ID prefix, or using metadata filters.

## Arguments

<ResponseField name="IDs" type="string[] | number[] | string | number" required>
  One or more vector IDs to delete.
</ResponseField>

**OR**

<ResponseField name="DeletePayload" type="object" required>
  <Expandable defaultOpen="true">
<Note>You can only use one of the `ids`, `prefix`, or `filter` fields.</Note>
    <ResponseField name="ids" type="string[] | number[] | string | number">
      One or more vector IDs to delete.
    </ResponseField>
    <ResponseField name="prefix" type="string">
      A string prefix to match vector IDs for deletion. All vectors with IDs
      starting with this prefix will be deleted.
    </ResponseField>
    <ResponseField name="filter" type="string">
      A metadata filter for vector deletion. See [Metadata
      Filtering](/vector/features/filtering) for more information.
      <Warning>
        Deleting vectors with metadata filter is a O(N) operation that performs a full
        scan. Therefore, it might be slow for large indexes.
      </Warning>
    </ResponseField>

  </Expandable>
</ResponseField>

<ResponseField name="Options" type="DeleteCommandOptions">
  <Expandable defaultOpen="true">
    <ResponseField name="namespace" type="string">
      Namespace to delete from. If not set, default namespace is used.
    </ResponseField>
  </Expandable>
</ResponseField>

## Response

<ResponseField name="Response" type="DeleteResult" required>
  <Expandable defaultOpen="true">
    <ResponseField name="deleted" type="number" required>
      The number of vectors that were successfully deleted.
    </ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>

```typescript Delete by IDs Array
const response = await index.delete(["2", "3"]);
// { deleted: 2 }
```

```typescript Delete Single ID
const response = await index.delete("2");
// { deleted: 1 }
```

```typescript Delete by Prefix
const response = await index.delete({
  prefix: "article_",
});
// { deleted: 3 }
```

```typescript Delete by Filter
const response = await index.delete({
  filter: "age > 30",
});
// { deleted: 3 }
```

</RequestExample>
