JSON.MGET
Syntax
JSON.MGET key [key ...] path
- Available in:
- Redis Stack / JSON 1.0.0
- Time complexity:
- O(M*N) when path is evaluated to a single value where M is the number of keys and N is the size of the value, O(N1+N2+...+Nm) when path is evaluated to multiple values where m is the number of keys and Ni is the size of the i-th key
Returns the values at path
from multiple key
arguments. Returns null for nonexistent keys and nonexistent paths.
Return
Array reply of Bulk string reply - the JSON serialization of the value at each key's path.
Examples
Given the following documents:
redis> JSON.SET doc1 $ '{"a":1, "b": 2, "nested": {"a": 3}, "c": null}'
OK
redis> JSON.SET doc2 $ '{"a":4, "b": 5, "nested": {"a": 6}, "c": null}'
OK
redis> JSON.MGET doc1 doc2 $..a
1) "[1,3]"
2) "[4,6]"
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.