content/commands/json.del.md
Delete a value
is key to modify.
</details>is JSONPath to specify. Default is root $. Nonexisting paths are ignored.
{{% alert title="Note" color="warning" %}}
Deleting an object's root is equivalent to deleting the key from Redis.
{{% /alert %}}
</details>Create a JSON document.
{{< highlight bash >}} redis> JSON.SET doc $ '{"a": 1, "nested": {"a": 2, "b": 3}}' OK {{< / highlight >}}
Delete specified values.
{{< highlight bash >}} redis> JSON.DEL doc $..a (integer) 2 {{< / highlight >}}
Get the updated document.
{{< highlight bash >}} redis> JSON.GET doc $ "[{"nested":{"b":3}}]" {{< / highlight >}}
</details>| Redis Software | Redis Cloud | <span style="min-width: 9em; display: table-cell">Notes</span> | |:----------------------|:-----------------|:------| | <span title="Supported">✅ Supported</span> | <span title="Supported">✅ Flexible & Annual</span> <span title="Supported">✅ Free & Fixed</nobr></span> | |
{{< multitabs id="json-del-return-info" tab1="RESP2" tab2="RESP3" >}}
[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): the number of paths deleted (0 or more).
-tab-sep-
[Integer reply]({{< relref "/develop/reference/protocol-spec#integers" >}}): the number of paths deleted (0 or more).
{{< /multitabs >}}
[JSON.SET]({{< relref "commands/json.set/" >}}) | [JSON.ARRLEN]({{< relref "commands/json.arrlen/" >}})