{
  "schema_version": 2,
  "id": "develop/data-types/json/resp3",
  "title": "Guide for migrating from RESP2 to RESP3 replies",
  "url": "https://redis.io/docs/latest/develop/data-types/json/resp3/",
  "summary": "JSON RESP2 to RESP3 replies reference for client developers",
  "tags": [
    "docs",
    "develop",
    "stack",
    "oss",
    "rs",
    "rc",
    "oss",
    "kubernetes",
    "clients"
  ],
  "last_updated": "2025-09-03T08:26:45-07:00",
  "page_type": "content",
  "content_hash": "c342517050a784083fe5a42f4a55591cc8608483a55eccc0f3b9e5a15b522c32",
  "sections": [
    {
      "id": "overview",
      "title": "Overview",
      "role": "overview",
      "text": "In RESP3, the default value of the optional path argument was changed from `.` to `$`. \nDue to this change, the replies of some commands have slightly changed. \nThis page provides a brief comparison between RESP2 and RESP3 responses for JSON commands to help developers in migrating their clients from RESP2 to RESP3."
    },
    {
      "id": "json-command-replies-comparison",
      "title": "JSON command replies comparison",
      "role": "content",
      "text": "The types are described using a [\"TypeScript-like\" syntax](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html). `Array<a>` denotes an [array](https://www.typescriptlang.org/docs/handbook/2/everyday-types.html#arrays) where the type of elements is known, but the number of elements is not.\n\n| Command                                                                                                                                                 | RESP2                                                                                                                                                                                            | RESP3                                                                                                                                                                                                               |\n|---------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| All JSON commands                                                                                                                                       | **Default value of optional `path` argument**: `.`                                                                                                                                               | **Default value of optional `path` argument:** `$`                                                                                                                                                                  |\n| JSON.ARRAPPEND<br/>JSON.ARRINDEX<br/>JSON.ARRINSERT<br/>JSON.ARRLEN<br/>JSON.ARRTRIM<br/>JSON.OBJLEN<br/>JSON.STRAPPEND<br/>JSON.STRLEN<br/>JSON.TOGGLE | *`$`-based path argument:* <br/> Reply: Array\\<BulkString &#124; null> <br/><br/> *`.`-based path argument :*&nbsp;<br/> Reply: BulkString                                                       | *`$`-based path argument:*&nbsp; <br/> Reply: Array\\<number &#124; null> <br/><br/> *`.`-based path argument :* <br/> Reply: number                                                                                 |\n| JSON.GET                                                                                                                                                | Reply: JSON encoded string  <br/> Example: <br/> [code example]> JSON.TYPE k $```<br />```1) \"array\"``` <br/><br/> *`.`-based path argument :*&nbsp;<br/> Reply: BulkString | *`$`-based path argument:* <br/> Reply: Array\\<Array\\<BulkString\\>> <br/> Example: <br />```> JSON.TYPE k $```<br />```1) 1) \"array\"``` <br/><br/> *`.`-based path argument :*&nbsp;<br/> Reply: Array\\<BulkString> |"
    }
  ],
  "examples": [
    {
      "id": "json-command-replies-comparison-ex0",
      "language": "> JSON.SET k $ \"[1,2,3]\"```<br/> ```> JSON.GET k```<br/>```\"[1,2,3]\"```                                                                      | Reply: JSON encoded string with a top-level array  <br/> Example: <br/> ```> JSON.SET k $ \"[1,2,3]\"```<br/> ```> JSON.GET k```<br/>```\"[[1,2,3]]\"```                                                                |",
      "code": "| JSON.NUMINCRBY<br/>JSON.NUMMULTBY                                                                                                                       | *`$`-based path argument:* <br/> Reply: JSON-encoded BulkString &#124; null <br/><br/> *`.`-based path argument :*&nbsp;<br/> Reply: BulkString &#124; null &#124; error                         | *`$`-based path argument:* <br/> Reply: Array\\<number &#124;  null> &#124; error <br/><br/> *`.`-based path argument :*&nbsp;<br/> Reply: number &#124;  null &#124; error                                          |\n| JSON.OBJKEYS                                                                                                                                            | *`$`-based path argument:* <br/> Reply: Array\\<Array\\<BulkString\\>> <br/><br/> *`.`-based path argument :*&nbsp;<br/> Reply: Array\\<BulkString>                                                  | *`$`-based path argument:* <br/> Reply: Array\\<Array\\<BulkString\\>> <br/><br/> *`.`-based path argument :*&nbsp;<br/> Reply: Array\\<BulkString>                                                                     |\n| JSON.TYPE                                                                                                                                               | *`$`-based path argument:* <br/> Reply: Array\\<BulkString\\> <br/> Example: <br />",
      "section_id": "json-command-replies-comparison"
    }
  ]
}
