{
  "schema_version": 2,
  "id": "commands/vdim",
  "title": "VDIM",
  "url": "https://redis.io/docs/latest/commands/vdim/",
  "summary": "Return the dimension of vectors in the vector set.",
  "since": "8.0.0",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-09-18T09:47:58+01:00",
  "page_type": "content",
  "content_hash": "165315c0751c07beaf7f3980e25990950d7bf0a9bf5dad22311587fa6b6fcd8d",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Return the number of dimensions of the vectors in the specified vector set.\n\n[code example]\n\nIf the vector set was created using the `REDUCE` option for dimensionality reduction, this command reports the reduced dimension. However, you must still use full-size vectors when performing queries with the `VSIM` command."
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open>\n<summary><code>key</code></summary>\n\nis the name of the key that holds the vector set.\n</details>"
    },
    {
      "id": "redis-software-and-redis-cloud-compatibility",
      "title": "Redis Software and Redis Cloud compatibility",
      "role": "content",
      "text": "| Redis<br />Software | Redis<br />Cloud | <span style=\"min-width: 9em; display: table-cell\">Notes</span> |\n|:----------------------|:-----------------|:------|\n| <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> | <span title=\"Supported\">&#x2705; Standard</span><br /><span title=\"Not supported\"><nobr>&#x274c; Active-Active</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nOne of the following:\n* [Integer reply](../../develop/reference/protocol-spec#integers): the number of vector set elements.\n* [Simple error reply](../../develop/reference/protocol-spec#simple-errors): if the key does not exist.\n\n**RESP3:**\n\nOne of the following:\n* [Integer reply](../../develop/reference/protocol-spec#integers): the number of vector set elements.\n* [Simple error reply](../../develop/reference/protocol-spec#simple-errors): if the key does not exist."
    },
    {
      "id": "related-topics",
      "title": "Related topics",
      "role": "related",
      "text": "- [Vector sets](https://redis.io/docs/latest/develop/data-types/vector-sets)"
    }
  ],
  "examples": [
    {
      "id": "overview-ex0",
      "language": "shell",
      "code": "VDIM word_embeddings\n(integer) 300",
      "section_id": "overview"
    }
  ]
}
