valkey-json) provides native storage and manipulation capabilities for JSON documents. It allows JSON data to be stored, queried, and modified directly as a tree structure. Using JSONPath expressions, such as $.store.book[0].title, you can precisely access any node within nested hierarchies. This module is suitable for scenarios that require flexible JSON structure operations, such as document-based configuration storage, API response caching, and nested object queries. This module is supported starting from Valkey 8.0 and is not part of the Redis core command set. Its core commands can be categorized into the following four types based on their functions:JSON.SET, JSON.GET, JSON.MGET, JSON.MSET, JSON.DEL (including the alias JSON.FORGET). These commands are used to set/obtain/read in batches/set in batches/delete JSON values within keys. Both the standard architecture and cluster architecture of Valkey 8.0 support them.JSON.STRAPPEND and JSON.STRLEN. These commands are used to append content to JSON strings and obtain string lengths. Both the standard architecture and cluster architecture of Valkey 8.0 support them.JSON.NUMINCRBY and JSON.NUMMULTBY. They are used to perform addition, subtraction, and multiplication operations on JSON numeric values. Both the Valkey 8.0 standard architecture and cluster architecture support them.JSON.ARRAPPEND, JSON.ARRINDEX, JSON.ARRINSERT, JSON.ARRLEN, JSON.ARRPOP, JSON.ARRTRIM. They are used to append elements to arrays, find element indexes, insert elements, obtain array lengths, pop elements, and trim arrays. Both the Valkey 8.0 standard architecture and cluster architecture support them.JSON.OBJKEYS, JSON.OBJLEN, and JSON.CLEAR. They are used to obtain object key names, obtain the number of object keys, and clear arrays or objects. Both the Valkey 8.0 standard architecture and cluster architecture support them.JSON.TYPE, JSON.TOGGLE, JSON.RESP, and JSON.DEBUG. They are used to obtain value types, toggle Boolean values, return JSON values in RESP format, and debug information. (The KEYTABLE-CORRUPT, KEYTABLE-CLEAR, and KEYTABLE-DISTRIBUTION subcommands of JSON.DEBUG require json.debug-mode to be enabled when the module is loaded.)JSON.MGET and JSON.MSET are multi-key commands. In a cluster architecture, all keys must reside in the same hash Slot (Slot); otherwise, a CROSSSLOT error is triggered. It is recommended to use Hash Tags (for example, {user}:profile and {user}:settings) to ensure that keys in the same group land in the same Slot.Command | Valkey 9.0 Standard Architecture | Valkey 9.0 Cluster Architecture | Valkey 8.0 Standard Architecture | Valkey 8.0 Cluster Architecture | Cross-Slot Support in Cluster Architecture |
json.set | ✓ | ✓ | ✓ | ✓ | — |
json.get | ✓ | ✓ | ✓ | ✓ | — |
json.mget | ✓ | ✓ | ✓ | ✓ | ✗ |
json.mset | ✓ | ✓ | ✓ | ✓ | ✗ |
json.del | ✓ | ✓ | ✓ | ✓ | — |
json.forget | ✓ | ✓ | ✓ | ✓ | — |
json.strappend | ✓ | ✓ | ✓ | ✓ | — |
json.strlen | ✓ | ✓ | ✓ | ✓ | — |
json.numincrby | ✓ | ✓ | ✓ | ✓ | — |
json.nummultby | ✓ | ✓ | ✓ | ✓ | — |
json.arrappend | ✓ | ✓ | ✓ | ✓ | — |
json.arrindex | ✓ | ✓ | ✓ | ✓ | — |
json.arrinsert | ✓ | ✓ | ✓ | ✓ | — |
json.arrlen | ✓ | ✓ | ✓ | ✓ | — |
json.arrpop | ✓ | ✓ | ✓ | ✓ | — |
json.arrtrim | ✓ | ✓ | ✓ | ✓ | — |
json.objkeys | ✓ | ✓ | ✓ | ✓ | — |
json.objlen | ✓ | ✓ | ✓ | ✓ | — |
json.clear | ✓ | ✓ | ✓ | ✓ | — |
json.type | ✓ | ✓ | ✓ | ✓ | — |
json.toggle | ✓ | ✓ | ✓ | ✓ | — |
json.resp | ✓ | ✓ | ✓ | ✓ | — |
json.debug | ✓ | ✓ | ✓ | ✓ | — |
フィードバック