Upstash Documentation

Range

2 min read

The range method is used to retrieve vectors in chunks with pagination. This method supports a variety of options to configure the query to your needs.

Note

The range command is stateless, meaning you need to pass all of the parameters in each subsequent request.

Arguments#

cursorstring | numberrequired#

The cursor to the last retrieved vector. Should be set to 0 in the initial range request.

prefixstring#

An string prefix to match vector IDs. All vectors with IDs that start with this prefix will be retrieved.

limitnumberrequired#

The number of maximum vectors wanted in the response of range. (page size)

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.

Response#

RangeResponserequired#
Show properties
nextCursorstring | numberrequired#

Cursor to use in the next range request.

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

The ID of the vector

vectornumber[]#

The vectors (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)