Use VECTOR.INFO to read the dimension and metric an index was created with.
Both values are fixed at creation, so this is how a client discovers the shape a vector must have before writing to an index it did not create. The reply is null when the index does not exist, which makes it the command to check existence with, since VECTOR.COUNT reports 0 for both a missing index and an empty one.
Vector indexes are an Upstash extension. See the vector command overview for how an index is created, written to, and queried.
Syntax#
Arguments#
| Argument | Required | Repeatable | Description |
|---|---|---|---|
<index> | Yes | No | Key holding the vector index. |
Response#
The reply reports the result of the operation. Error replies have the same shape in RESP2 and RESP3 and are surfaced as exceptions by the SDKs below.
| Protocol | Reply |
|---|---|
| RESP2 | Flat array of alternating field names and values, or Null array |
| RESP3 | Map, or Null |
Fields#
| Field | Description |
|---|---|
dimension | Number of elements in every vector in the index. |
metric | Similarity metric: COSINE, EUCLIDEAN, or DOT. |
Client libraries often decode bulk strings, maps, sets, and numeric strings into language-native values. The table describes the Redis wire reply.
Examples#
TCP examples use the TLS REDIS_URL from the Upstash console. REST examples use UPSTASH_REDIS_REST_URL and UPSTASH_REDIS_REST_TOKEN.
Redis CLI
@upstash/redis
This command is not supported yet in @upstash/redis.
upstash_redis
This command is not supported yet in upstash_redis.