curl $UPSTASH_VECTOR_REST_URL/range \
-H "Authorization: Bearer $UPSTASH_VECTOR_REST_TOKEN" \
-d '{ "cursor": "0", "limit": 2, "includeMetadata": true }'
curl $UPSTASH_VECTOR_REST_URL/range/ns \
-H "Authorization: Bearer $UPSTASH_VECTOR_REST_TOKEN" \
-d '{ "cursor": "0", "limit": 2, "includeMetadata": true }'
{
"result": {
"nextCursor": "2",
"vectors": [
{
"id": "id-0",
"metadata": {
"link": "upstash.com"
}
},
{
"id": "id-1"
}
]
}
}
Endpoints
Range Vectors
Ranges over vectors starting(inclusive) from a cursor until the end of the vectors in the or given limit.
GET
/
range
/
{namespace}
curl $UPSTASH_VECTOR_REST_URL/range \
-H "Authorization: Bearer $UPSTASH_VECTOR_REST_TOKEN" \
-d '{ "cursor": "0", "limit": 2, "includeMetadata": true }'
curl $UPSTASH_VECTOR_REST_URL/range/ns \
-H "Authorization: Bearer $UPSTASH_VECTOR_REST_TOKEN" \
-d '{ "cursor": "0", "limit": 2, "includeMetadata": true }'
{
"result": {
"nextCursor": "2",
"vectors": [
{
"id": "id-0",
"metadata": {
"link": "upstash.com"
}
},
{
"id": "id-1"
}
]
}
}
By default vectors from the default namespace will be iterated.
You can use a different namespace by specifying it in the request path.
Request
string
required
The offset to the last retrieved vector. Should be set to
"0" in the initial
range.string
Prefix of the vector ids to range over.
number
required
The number of maximum vectors that you want in the response of range. (page
size)
boolean
default:"false"
Whether to include the metadata of the vectors in the response, if any.
It is recommended to set this to
true to easily identify vectors.boolean
default:"false"
Whether to include the vector values in the response.
It is recommended to set this to
false as the vector values can be
quite big, and not needed most of the time.boolean
default:"false"
Whether to include the data of the vectors in the response, if any.
Path
string
default:""
The namespace to use.
When no namespace is specified, the default namespace will be used.
Response
string
required
The offset for the next range. You should place this in the
cursor field for
the next range. It will be equal to empty string if there are no other vectors to range.Object[]
required
Hide child attributes
Hide child attributes
string
required
The id of the vector.
number[]
The dense vector value for dense and hybrid indexes.
Object[]
Object
The metadata of the vector, if any.
string
The unstructured data of the vector, if any.
curl $UPSTASH_VECTOR_REST_URL/range \
-H "Authorization: Bearer $UPSTASH_VECTOR_REST_TOKEN" \
-d '{ "cursor": "0", "limit": 2, "includeMetadata": true }'
curl $UPSTASH_VECTOR_REST_URL/range/ns \
-H "Authorization: Bearer $UPSTASH_VECTOR_REST_TOKEN" \
-d '{ "cursor": "0", "limit": 2, "includeMetadata": true }'
{
"result": {
"nextCursor": "2",
"vectors": [
{
"id": "id-0",
"metadata": {
"link": "upstash.com"
}
},
{
"id": "id-1"
}
]
}
}
Was this page helpful?