EsRedisJsonCommands
Description
Provides an API for the RedisJSON module commands. RedisJSON is a
module that provides native JSON data type support in Redis. It allows for storing, updating, and retrieving JSON values within Redis keys, with full support for the JSON standard and a JSONPath-like syntax for
selecting elements inside documents.
This command group is accessed via EsRedisClient>>json.
Class Methods
None
Instance Methods
jsonArrAppend:path:values:
Append one or more values to a JSON array.
Arguments:
aKey - <String> The key of the JSON document.
aPath - <String> The JSONPath to specify the array.
aCollection - <Collection> The values to append.
Answers:
<Array> An array of integers, where each integer is the new size of the array at the specified path.
<EsFuture> In async mode, a future that completes with the result.
jsonArrIndex:path:value:
Find the first occurrence of a value in a JSON array.
Arguments:
aKey - <String> The key of the JSON document.
aPath - <String> The JSONPath to specify the array.
aValue - <Object> The value to search for.
Answers:
<Integer> The index of the value, or -1 if not found.
<EsFuture> In async mode, a future that completes with the result.
jsonArrInsert:path:index:values:
Insert one or more values into a JSON array at a specific index.
Arguments:
aKey - <String> The key of the JSON document.
aPath - <String> The JSONPath to specify the array.
anInteger - <Integer> The index to insert at.
aCollection - <Collection> The values to insert.
Answers:
<Integer> The new size of the array.
<EsFuture> In async mode, a future that completes with the result.
jsonArrLen:path:
Get the length of a JSON array.
Arguments:
aKey - <String> The key of the JSON document.
aPath - <String> The JSONPath to specify the array.
Answers:
<Integer> The length of the array, or nil if the path does not exist.
<EsFuture> In async mode, a future that completes with the result.
jsonArrPop:path:index:
Remove and return an element from a JSON array.
Arguments:
aKey - <String> The key of the JSON document.
aPath - <String> The JSONPath to specify the array.
anInteger - <Integer> The index of the element to pop.
Answers:
<Object> The popped element, or nil if the index is out of bounds.
<EsFuture> In async mode, a future that completes with the result.
jsonArrTrim:path:start:stop:
Trim a JSON array to a specified range.
Arguments:
aKey - <String> The key of the JSON document.
aPath - <String> The JSONPath to specify the array.
startInteger - <Integer> The starting index.
stopInteger - <Integer> The ending index.
Answers:
<Integer> The new size of the array.
<EsFuture> In async mode, a future that completes with the result.
jsonClear:path:
Clear container values (arrays or objects) and set numeric values to 0.
Arguments:
aKey - <String> The key of the JSON document.
aPath - <String> The JSONPath to modify.
Answers:
<Integer> The number of values cleared.
<EsFuture> In async mode, a future that completes with the result.
jsonDel:path:
Delete a value.
Arguments:
aKey - <String> The key of the JSON document.
aPath - <String> The JSONPath to delete.
Answers:
<Integer> The number of paths deleted.
<EsFuture> In async mode, a future that completes with the result.
jsonGet:paths:
Get the value at one or more paths in a JSON document.
Arguments:
aKey - <String> The key of the JSON document.
aCollectionOfPaths - <Collection> The JSONPaths to retrieve.
Answers:
<String> The JSON formatted string of the values.
<EsFuture> In async mode, a future that completes with the result.
jsonMget:path:
Get the value at a path from multiple keys.
Arguments:
aCollectionOfKeys - <Collection> The keys to retrieve from.
aPath - <String> The JSONPath to retrieve.
Answers:
<Array> An array of JSON formatted strings.
<EsFuture> In async mode, a future that completes with the result.
jsonNumIncrBy:path:by:
Increment a numeric value at one or more paths.
Arguments:
aKey - <String> The key of the JSON document.
aPath - <String> The JSONPath to the number(s) to increment. Can be a wildcard.
aNumber - <Number> The amount to increment by.
Answers:
<Array of Number> An array containing the new numeric values for each
path that was updated. The return type is normalized
to an Array of Numbers regardless of the Redis
protocol version.
<EsFuture> In async mode, a future that completes with the result.
jsonObjKeys:path:
Get the keys in a JSON object.
Arguments:
aKey - <String> The key of the JSON document.
aPath - <String> The JSONPath of the object.
Answers:
<Array> An array of keys in the object.
<EsFuture> In async mode, a future that completes with the result.
jsonObjLen:path:
Get the number of keys in a JSON object.
Arguments:
aKey - <String> The key of the JSON document.
aPath - <String> The JSONPath of the object.
Answers:
<Integer> The number of keys in the object.
<EsFuture> In async mode, a future that completes with the result.
jsonSet:path:value:
Set the JSON value at a path.
Arguments:
aKey - <String> The key of the JSON document.
aPath - <String> The JSONPath to set.
aJsonString - <String> The JSON value to set.
Answers:
<String> 'OK'.
<EsFuture> In async mode, a future that completes with the result.
jsonStrAppend:path:value:
Append a string to a JSON string value.
Arguments:
aKey - <String> The key of the JSON document.
aPath - <String> The JSONPath of the string.
aString - <String> The string to append.
Answers:
<Integer> The new length of the string.
<EsFuture> In async mode, a future that completes with the result.
jsonStrLen:path:
Get the length of a JSON string value.
Arguments:
aKey - <String> The key of the JSON document.
aPath - <String> The JSONPath of the string.
Answers:
<Integer> The length of the string.
<EsFuture> In async mode, a future that completes with the result.
jsonToggle:path:
Toggle a boolean value.
Arguments:
aKey - <String> The key of the JSON document.
aPath - <String> The JSONPath of the boolean.
Answers:
<Integer> The new value (0 or 1).
<EsFuture> In async mode, a future that completes with the result.
jsonType:path:
Get the type of a JSON value.
Arguments:
aKey - <String> The key of the JSON document.
aPath - <String> The JSONPath to check. Can be a wildcard.
Answers:
<Array of String> An array of types for each path matched (e.g., #('string')).
The return format is normalized to a simple, flat array
of strings to ensure consistency across protocol versions
and single/multi-path queries.
<EsFuture> In async mode, a future that completes with the result.
Last modified date: 01/22/2026