Upstash Documentation

Update Vector

Updates a vector, data or metadata.
2 min read
posthttps://{endpoint}/update/{namespace}
posthttps://{endpoint}/update/{namespace}
Tip

The vector will be updated int the default namespace by default. You can use a different namespace by specifying it in the request path.

Request#

You can update a vector value, data, or metadata; or any combination of those.

idstringrequired#

The id of the vector.

vectornumber[]#
The dense vector value to update to for dense and hybrid indexes.
Note
The vector should have the same dimensions as your index.
sparseVectorObject[]#

The sparse vector value to update to for sparse and hybrid indexes.

Show properties
indicesnumber[]#

Indices of the non-zero valued dimensions.

valuesnumber[]#

Values of the non-zero valued dimensions.

datastring#
The raw text data to update to.
Note
If the index is created with an embedding model this will embed the data into a vector and will also update the vector, along with data.
metadataObject#

The metadata to update to.

metadataUpdateModestring#

Whether to overwrite the whole metadata while updating it, or patch the metadata (insert new fields or update or delete existing fields) according to the RFC 7396 JSON Merge Patch algorithm.

OVERWRITE for overwrite, PATCH for patch.

Note

For hybrid indexes either none or both of vector and sparseVector fields must be present. It is not allowed to update only vector or sparseVector.

Path#

namespacestring#

The namespace to use. When no namespace is specified, the default namespace will be used.

Default: ""

Response#

updatednumber#

1 if any vector is updated, 0 otherwise.