Upstash Documentation home page
Search...
⌘K
Ask AI
Discord
Blog
Twitter
Console
Console
Search...
Navigation
Commands
Delete
Overview
Redis
Vector
QStash
Workflow
Search
Developer API
Overall
Quickstarts
Search UI
Features
SDKs
Typescript
Python
Getting Started
Commands
Search
Upsert
Fetch
Delete
Range
Reset
Info
Integrations
Tools
Help
Delete by IDs Array
Delete by Prefix
Delete with Filter
Copy
Ask AI
index
.
delete
(
ids
=
[
"star-wars"
,
"inception"
]);
Commands
Delete
Delete by IDs Array
Delete by Prefix
Delete with Filter
Copy
Ask AI
index
.
delete
(
ids
=
[
"star-wars"
,
"inception"
]);
Delete Command for Python SDK
The delete method allows you to delete documents from your index using various criteria.
Arguments
DeletePayload
object
required
Hide child attributes
ids
string[] | number[] | string | number
One or more document IDs to delete.
prefix
string
A string prefix to match document IDs for deletion. All documents with IDs starting with this prefix will be deleted.
filter
string
A
filter
to delete documents based on content fields.
Deleting document with filter is a O(N) operation that performs a full scan. Therefore, it might be slow for large indexes.
Response
Response
int
required
The number of documents that were successfully deleted.
Delete by IDs Array
Delete by Prefix
Delete with Filter
Copy
Ask AI
index
.
delete
(
ids
=
[
"star-wars"
,
"inception"
]);
Was this page helpful?
Yes
No
Suggest edits
Raise issue
Fetch
Range
Assistant
Responses are generated using AI and may contain mistakes.