Upstash Documentation

Delete

1 min read

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#

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

One or more vector IDs to delete.

OR

DeletePayloadobjectrequired#
Show properties
Note
You can only use one of the ids, prefix, or filter fields.
idsstring[] | number[] | string | number#

One or more vector IDs to delete.

prefixstring#

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

filterstring#

A metadata filter for vector deletion. See Metadata 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.

OptionsDeleteCommandOptions#
Show properties
namespacestring#

Namespace to delete from. If not set, default namespace is used.

Response#

ResponseDeleteResultrequired#
Show properties
deletednumberrequired#

The number of vectors that were successfully deleted.