Usage
Arguments
The key containing the JSON document
Optional formatting options for the returned JSON string
JSONPath expression(s) to specify which parts of the JSON to retrieve. If not specified, returns the entire JSON document.
Response
The JSON value at the specified path, or
null if the key doesn’t exist. The return type is generic and can be specified using TypeScript.Examples
Get entire JSON document
Get specific path
Get with formatting options
Get multiple paths
JSONPath Syntax
Upstash Redis supports JSONPath expressions for querying JSON documents:$- Root element$.field- Access a field$.field[0]- Access array element$..field- Recursive descent$.field[*]- All array elements
See Also
- JSON.SET - Set JSON values
- JSON.DEL - Delete JSON values
- Redis JSON.GET documentation