Back to Redis

Commands

content/operate/oss_and_stack/stack-with-enterprise/json/commands.md

latest8.1 KB
Original Source

The following table lists JSON commands. See the command links for more information about each command's syntax, arguments, and examples.

| Command | Redis Software | Redis Cloud | Description | |:--------|:----------------------|:-----------------|:------| | [JSON.ARRAPPEND]({{< relref "commands/json.arrappend" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported"><nobr>✅ Flexible & Annual</nobr></span> <span title="Supported">✅ Free & Fixed</nobr></span> | Appends an element to a JSON array. | | [JSON.ARRINDEX]({{< relref "commands/json.arrindex" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Returns the index of a value's first occurrence in a JSON array. | | [JSON.ARRINSERT]({{< relref "commands/json.arrinsert" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Inserts JSON values into a JSON array before the given index. | | [JSON.ARRLEN]({{< relref "commands/json.arrlen" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Returns the length of a JSON array. | | [JSON.ARRPOP]({{< relref "commands/json.arrpop" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Removes and returns an element located at the index in the JSON array. | | [JSON.ARRTRIM]({{< relref "commands/json.arrtrim" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Trims a JSON array so that it contains only the specified inclusive range of elements. | | [JSON.CLEAR]({{< relref "commands/json.clear" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Clears container values (arrays/objects) and sets numeric values to 0. | | [JSON.DEBUG]({{< relref "commands/json.debug" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Debugging container command. | | [JSON.DEBUG HELP]({{< relref "commands/json.debug-help" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Returns helpful information about the [JSON.DEBUG]({{< relref "commands/json.debug" >}}) command. | | [JSON.DEBUG MEMORY]({{< relref "commands/json.debug-memory/" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Reports a JSON element's memory usage in bytes. | | [JSON.DEL]({{< relref "commands/json.del" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Removes a JSON element. | | [JSON.FORGET]({{< relref "commands/json.forget" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Removes a JSON element, the same as [JSON.DEL]({{< relref "commands/json.del" >}}). | | [JSON.GET]({{< relref "commands/json.get" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Returns the value of an element in JSON-serialized form. | | [JSON.MGET]({{< relref "commands/json.mget" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Returns the values of multiple elements. | | [JSON.MERGE]({{< relref "commands/json.merge" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Merge a given JSON value into matching paths. | | [JSON.NUMINCRBY]({{< relref "commands/json.numincrby" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Increments the number stored at path by the specified number. | | [JSON.NUMMULTBY]({{< relref "commands/json.nummultby" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Multiplies the number stored at path by the specified number. (deprecated as of RedisJSON v2.0) | | [JSON.OBJKEYS]({{< relref "commands/json.objkeys" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Returns the keys contained in the specified JSON object. | | [JSON.OBJLEN]({{< relref "commands/json.objlen" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Returns the number of keys in the specified JSON object. | | [JSON.RESP]({{< relref "commands/json.resp" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Returns a JSON element in [Redis Serialization Protocol (RESP)]({{< relref "/develop/reference/protocol-spec" >}}) format. | | [JSON.SET]({{< relref "commands/json.set" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Sets the value of a JSON element. | | [JSON.STRAPPEND]({{< relref "commands/json.strappend" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Appends the given string to the specified key's existing strings. | | [JSON.STRLEN]({{< relref "commands/json.strlen" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Returns the length of a string. | | [JSON.TOGGLE]({{< relref "commands/json.toggle" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | If the boolean is true, changes it to false. If the boolean is false, changes it to true. | | [JSON.TYPE]({{< relref "commands/json.type" >}}) | <span title="Supported">✅ Supported</span> <span> </span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | Returns a JSON element's type. |