JSON.DEL
JSON.DEL key [path]
Delete a value
keyis key to modify.
pathis JSONPath to specify. Default is root $. Nonexisting paths are ignored.
Deleting an object's root is equivalent to deleting the key from Redis.
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.
Create a JSON document.
127.0.0.1:6379> JSON.SET doc $ '{"a": 1, "nested": {"a": 2, "b": 3}}'
OKDelete specified values.
127.0.0.1:6379> JSON.DEL doc $..a
(integer) 2Get the updated document.
127.0.0.1:6379> JSON.GET doc $
"[{\"nested\":{\"b\":3}}]"
© 2006–2022 Salvatore Sanfilippo
Licensed under the Creative Commons Attribution-ShareAlike License 4.0.
https://redis.io/commands/json.del/