Delete a value
key
is key to modify.
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 %}}
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.
Delete a value
Create a JSON document.
{{< highlight bash >}} 127.0.0.1:6379> JSON.SET doc $ '{"a": 1, "nested": {"a": 2, "b": 3}}' OK {{< / highlight >}}
Delete specified values.
{{< highlight bash >}} 127.0.0.1:6379> JSON.DEL doc $..a (integer) 2 {{< / highlight >}}
Get the updated document.
{{< highlight bash >}} 127.0.0.1:6379> JSON.GET doc $ "[{"nested":{"b":3}}]" {{< / highlight >}}
JSON.SET
| JSON.ARRLEN