Delete a value [Examples](#examples) ## Required arguments
key is key to modify.
## Optional arguments
path 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 %}}
## Return JSON.DEL returns an integer reply specified as the number of paths deleted (0 or more). For more information about replies, see [Redis serialization protocol specification](/docs/reference/protocol-spec). ## Examples
Delete a value 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 >}}
## See also `JSON.SET` | `JSON.ARRLEN` ## Related topics * [RedisJSON](/docs/stack/json) * [Index and search JSON documents](/docs/stack/search/indexing_json)