Deletes a value at the specified path in a JSON document. If no path is specified, deletes the entire key.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/upstash/redis-js/llms.txt
Use this file to discover all available pages before exploring further.
Usage
Arguments
The key containing the JSON document
JSONPath expression specifying which parts to delete. If omitted, deletes the entire key.
Response
The number of paths deleted. Returns
0 if the key or path doesn’t exist.Examples
Delete entire JSON document
Delete specific field
Delete nested field
Delete array element
Delete multiple paths
Check if deletion was successful
JSONPath Syntax
$- Root element (deletes entire document)$.field- Delete a specific field$.field[0]- Delete array element at index$.nested.field- Delete nested field$..field- Delete all matching fields recursively$.array[*]- Delete all array elements
See Also
- JSON.GET - Get JSON values
- JSON.SET - Set JSON values
- Redis JSON.DEL documentation