Upstash Documentation

Delete

2 min read

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

Arguments#

IDsstring[] | number[] | string | numberrequired#

One or more document IDs to delete.

OR

DeletePayloadobjectrequired#
Show properties
idsstring[] | number[] | string | number#

One or more document IDs to delete.

prefixstring#

A string prefix to match document IDs for deletion. All documents with IDs starting with this prefix will be deleted.

filterstring#

A filter to delete documents based on content fields.

Warning

Deleting document with filter is a O(N) operation that performs a full scan. Therefore, it might be slow for large indexes.

Response#

ResponseDeleteResultrequired#
Show properties
deletednumberrequired#

The number of documents that were successfully deleted.