Upstash Documentation

Fetch

2 min read

Used to retrieve the vector by ID.

Arguments#

IDsstring[] | number[]required#

The IDs of the vectors you want to fetch.

OR

FetchPayloadobjectrequired#
Show properties
idsstring[] | number[]#

The IDs of the vectors you want to fetch.

prefixstring#

An id prefix to match vector IDs.

Warning

For fetching larger datasets with prefix, it is recommended to use the paginated range command instead.

OptionsObject#
Show properties
includeMetadataboolean#

Whether to include the metadata of the vectors in the response. Setting this true would be the best practice, since it will make it easier to identify the vectors.

includeVectorsboolean#

Whether to include the vector themselves in the response.

includeDataboolean#

Whether to include the data field in the response.

namespacestring#

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

Response#

FetchResult[]Vector[]required#

This field is null if no vector with the specified id is found.

Show properties
idstring | numberrequired#

The ID of the resulting vector.

vectornumber[]#

The vectors (if includeVectors is set to true)

sparseVectorSparseVector#

The resulting sparseVector (if includeVectors is set to true)

metadataRecord<string, unknown>#

The metadata of the vectors (if includeMetadata is set to true)

datastring#

The data of the vector (if includeData is set to true)