Retrieves the JSON value stored at the specified key and optionally formats the output.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
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