{
  "id": "json.type",
  "title": "JSON.TYPE",
  "url": "https://redis.io/docs/latest/commands/json.type/",
  "summary": "Returns the type of the JSON value at path",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2026-04-09T10:29:34-04:00",
  "page_type": "content",
  "content_hash": "c03b21a520bbd3b25f1cd55ed04306b25cab8f68f9a518a2f00adf61a7b7fed5",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "Report the type of JSON value at `path`\n\n[Examples](#examples)"
    },
    {
      "id": "required-arguments",
      "title": "Required arguments",
      "role": "content",
      "text": "<details open><summary><code>key</code></summary> \n\nis key to parse.\n</details>"
    },
    {
      "id": "optional-arguments",
      "title": "Optional arguments",
      "role": "parameters",
      "text": "<details open><summary><code>path</code></summary> \n\nis JSONPath to specify. Default is root `$`. Returns null if the `key` or `path` do not exist.\n\n</details>"
    },
    {
      "id": "examples",
      "title": "Examples",
      "role": "example",
      "text": "redis> JSON.SET doc $ '{\"a\":2, \"nested\": {\"a\": true}, \"foo\": \"bar\"}'\nOK\nredis> JSON.TYPE doc $..foo\n1) \"string\"\nredis> JSON.TYPE doc $..a\n1) \"integer\"\n2) \"boolean\"\nredis> JSON.TYPE doc $..dummy\n(empty array)"
    },
    {
      "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; Supported</span><br /> | <span title=\"Supported\">&#x2705; Flexible & Annual</span><br /><span title=\"Supported\">&#x2705; Free & Fixed</nobr></span> |  |"
    },
    {
      "id": "return-information",
      "title": "Return information",
      "role": "returns",
      "text": "**RESP2:**\n\nWith `$`-based path argument: [Array reply]() of [bulk string replies](), where each element is the type of the matching value.\n\nWith `.`-based path argument: [Bulk string reply]() representing the type of the matching value.\n\n**RESP3:**\n\nWith `$`-based path argument (default): [Array reply]() of [array replies]() of [bulk string replies](), where each nested array contains the type of the matching value.\n\nWith `.`-based path argument: [Array reply]() of [bulk string replies]() representing the type of the matching value."
    },
    {
      "id": "see-also",
      "title": "See also",
      "role": "related",
      "text": "[`JSON.SET`]() | [`JSON.ARRLEN`]()"
    },
    {
      "id": "related-topics",
      "title": "Related topics",
      "role": "related",
      "text": "* [RedisJSON]()\n* [Index and search JSON documents]()"
    }
  ],
  "examples": []
}
