Upstash Documentation

Upsert

1 min read

Used to add new vectors or update an existing vector.

Note

You can only upsert vectors with same dimension count(size) as your index.

Arguments#

There are two ways to use the upsert method. You can either create the vectors on your own and pass them directly. Or you can pass the data and create the embeddings using Upstash Embedding. The possible payloads are:

VectorPayloadVector | Vector[]required#
Show properties
idstring | numberrequired#

The ID of the vector

vectornumber[]required#

The vectors to add to the store

metadataRecord<string, unknown>#

Metadata of the vector

Namespace{ namespace?: string }#

Namespace to upsert to. If not set, default namespace is used.

OR

DataPayloadData | Data[]required#
Show properties
idstring | numberrequired#

The ID of the vector

datastringrequired#

The vectors to add to the store

metadataRecord<string, unknown>#

Metadata of the vector

Namespace{ namespace?: string }#

Namespace to upsert to. If not set, default namespace is used.

Response#