JSON.RESP
Syntax
JSON.RESP key [path]
- Available in:
- Redis Stack / JSON 1.0.0
- Time complexity:
- O(N) when path is evaluated to a single value, where N is the size of the value, O(N) when path is evaluated to multiple values, where N is the size of the key
Returns the JSON in key
in [Redis Serialization Protocol (RESP)][5] form.
path
defaults to root if not provided. This command uses the following mapping from JSON to RESP:
- JSON Null maps to the Bulk string reply
- JSON
false
andtrue
values map to Simple string reply - JSON Numbers map to Integer reply or Bulk string reply, depending on type
- JSON Strings map to Bulk string reply
- JSON Arrays are represented as Array reply in which the first element is the Simple string reply
[
followed by the array's elements - JSON Objects are represented as Array reply in which the first element is the Simple string reply
{
. Each successive entry represents a key-value pair as a two-entry Array reply of Bulk string reply.
Return
Array reply - the JSON's RESP form as detailed.
Feedback
If you've found issues on this page, or have suggestions for improvement, please submit a request to merge or open an issue in the repository.