# Delete records

Delete records with primary keys:

{% tabs %}
{% tab title="Python" %}

```python
status_code, response = db.delete(
  table_name="MyTable",        # The name of the table to delete records against.
  primary_keys=[1, 2, 5]       # The primary keys of the records to be deleted.
)
print(response)
```

Response example:

```
{'statusCode': 200, 'message': 'Delete data from MyTable successfully.', 'result': {'deleted': 3}}
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const query = await db.delete(
  'MyTable',                  // The name of the table to delete records against.
  {
    primaryKeys: [1, 2, 5]    // The primary keys of the records to be deleted.
  }
);
console.log(JSON.stringify(query, undefined, 2));
```

Response example:

```
{
  "statusCode": 200,
  "message": "Delete data from MyTable successfully.",
  "result": {
    "deleted": 3
  }
}
```

{% endtab %}
{% endtabs %}

Delete all records that satisfy a filter condition:

{% tabs %}
{% tab title="Python" %}

```python
status_code, response = db.delete(
  table_name="MyTable",                 # The name of the table to delete records against.
  filter="ID < 6 AND Doc <> 'London'",  # (Optional) a boolean expression for specifying
                                        # which records to be deleted.
)
print(response)
```

Response example:

```
{'statusCode': 200, 'message': 'Delete data from MyTable successfully.', 'result': {'deleted': 14}}
```

{% endtab %}

{% tab title="JavaScript" %}

```javascript
const query = await db.delete(
  'MyTable',                                 // The name of the table to delete records against.
  {
    filter: 'ID < 6 AND Doc <> \'London\''   // (Optional) a boolean expression for specifying
                                             // which records to be deleted.
  }
);
console.log(JSON.stringify(query, undefined, 2));
```

Response example:

```
{
  "statusCode": 200,
  "message": "Delete data from MyTable successfully.",
  "result": {
    "deleted": 14
  }
}
```

{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://epsilla-inc.gitbook.io/epsilladb/epsilla-vector-database/user-manual/api-reference-1.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
