JSON.DEL key [path]

Available in: Redis Stack

Time complexity: O(N) when path is evaluated to a single value where N is the size of the deleted value, O(N) when path is evaluated to multiple values, where N is the size of the key

Deletes a value.

path defaults to root if not provided. Ignores nonexistent keys and paths. Deleting an object's root is equivalent to deleting the key from Redis.

Return

Integer reply - the number of paths deleted (0 or more).

Examples

redis> JSON.SET doc $ '{"a": 1, "nested": {"a": 2, "b": 3}}'
OK
redis> JSON.DEL doc $..a
(integer) 2