K - Key type.V - Value type.public interface NodeSelectionJsonCommands<K,V>
| Modifier and Type | Method and Description |
|---|---|
Executions<List<Long>> |
jsonArrappend(K key,
JsonPath jsonPath,
JsonValue... values)
Append the JSON values into the array at a given
JsonPath after the last element in a said array. |
Executions<List<Long>> |
jsonArrappend(K key,
JsonValue... values)
Append the JSON values into the array at the
JsonPath.ROOT_PATH after the last element in a said array. |
Executions<List<Long>> |
jsonArrindex(K key,
JsonPath jsonPath,
JsonValue value)
|
Executions<List<Long>> |
jsonArrindex(K key,
JsonPath jsonPath,
JsonValue value,
JsonRangeArgs range)
|
Executions<List<Long>> |
jsonArrinsert(K key,
JsonPath jsonPath,
int index,
JsonValue... values)
|
Executions<List<Long>> |
jsonArrlen(K key)
Report the length of the JSON array at a the
JsonPath.ROOT_PATH |
Executions<List<Long>> |
jsonArrlen(K key,
JsonPath jsonPath)
Report the length of the JSON array at a given
JsonPath |
Executions<List<JsonValue>> |
jsonArrpop(K key)
Remove and return
JsonValue at index -1 (last element) in the array at the JsonPath.ROOT_PATH |
Executions<List<JsonValue>> |
jsonArrpop(K key,
JsonPath jsonPath)
|
Executions<List<JsonValue>> |
jsonArrpop(K key,
JsonPath jsonPath,
int index)
|
Executions<List<Long>> |
jsonArrtrim(K key,
JsonPath jsonPath,
JsonRangeArgs range)
Trim an array at a given
JsonPath so that it contains only the specified inclusive range of elements. |
Executions<Long> |
jsonClear(K key)
Clear container values (arrays/objects) and set numeric values to 0 at the
JsonPath.ROOT_PATH |
Executions<Long> |
jsonClear(K key,
JsonPath jsonPath)
Clear container values (arrays/objects) and set numeric values to 0
|
Executions<Long> |
jsonDel(K key)
Deletes a value inside the JSON document at the
JsonPath.ROOT_PATH |
Executions<Long> |
jsonDel(K key,
JsonPath jsonPath)
Deletes a value inside the JSON document at a given
JsonPath |
Executions<List<JsonValue>> |
jsonGet(K key,
JsonGetArgs options,
JsonPath... jsonPaths)
Return the value at the specified path in JSON serialized form.
|
Executions<List<JsonValue>> |
jsonGet(K key,
JsonPath... jsonPaths)
Return the value at the specified path in JSON serialized form.
|
Executions<String> |
jsonMerge(K key,
JsonPath jsonPath,
JsonValue value)
|
Executions<List<JsonValue>> |
jsonMGet(JsonPath jsonPath,
K... keys)
Return the values at the specified path from multiple key arguments.
|
Executions<String> |
jsonMSet(List<JsonMsetArgs<K,V>> arguments)
Set or update one or more JSON values according to the specified
JsonMsetArgs
JSON.MSET is atomic, hence, all given additions or updates are either applied or not. |
Executions<List<Number>> |
jsonNumincrby(K key,
JsonPath jsonPath,
Number number)
Increment the number value stored at the specified
JsonPath in the JSON document by the provided increment. |
Executions<List<V>> |
jsonObjkeys(K key)
Return the keys in the JSON document that are referenced by the
JsonPath.ROOT_PATH |
Executions<List<V>> |
jsonObjkeys(K key,
JsonPath jsonPath)
Return the keys in the JSON document that are referenced by the given
JsonPath |
Executions<List<Long>> |
jsonObjlen(K key)
Report the number of keys in the JSON object at the
JsonPath.ROOT_PATH and for the provided key |
Executions<List<Long>> |
jsonObjlen(K key,
JsonPath jsonPath)
Report the number of keys in the JSON object at the specified
JsonPath and for the provided key |
Executions<String> |
jsonSet(K key,
JsonPath jsonPath,
JsonValue value)
Sets the JSON value at a given
JsonPath in the JSON document using defaults for the JsonSetArgs. |
Executions<String> |
jsonSet(K key,
JsonPath jsonPath,
JsonValue value,
JsonSetArgs options)
Sets the JSON value at a given
JsonPath in the JSON document. |
Executions<List<Long>> |
jsonStrappend(K key,
JsonPath jsonPath,
JsonValue value)
Append the json-string values to the string at the provided
JsonPath in the JSON document. |
Executions<List<Long>> |
jsonStrappend(K key,
JsonValue value)
Append the json-string values to the string at the
JsonPath.ROOT_PATH in the JSON document. |
Executions<List<Long>> |
jsonStrlen(K key)
Report the length of the JSON String at the
JsonPath.ROOT_PATH in the JSON document. |
Executions<List<Long>> |
jsonStrlen(K key,
JsonPath jsonPath)
Report the length of the JSON String at the provided
JsonPath in the JSON document. |
Executions<List<Long>> |
jsonToggle(K key,
JsonPath jsonPath)
Toggle a Boolean value stored at the provided
JsonPath in the JSON document. |
Executions<List<JsonType>> |
jsonType(K key)
Report the type of JSON value at the
JsonPath.ROOT_PATH in the JSON document. |
Executions<List<JsonType>> |
jsonType(K key,
JsonPath jsonPath)
Report the type of JSON value at the provided
JsonPath in the JSON document. |
Executions<List<Long>> jsonArrappend(K key, JsonPath jsonPath, JsonValue... values)
JsonPath after the last element in a said array.Executions<List<Long>> jsonArrappend(K key, JsonValue... values)
JsonPath.ROOT_PATH after the last element in a said array.key - the key holding the JSON document.values - one or more JsonValue to be appended.Executions<List<Long>> jsonArrindex(K key, JsonPath jsonPath, JsonValue value, JsonRangeArgs range)
JsonValue in an array at a given JsonPath and return its index.key - the key holding the JSON document.jsonPath - the JsonPath pointing to the array inside the document.value - the JsonValue to search for.range - the JsonRangeArgs to search within.Executions<List<Long>> jsonArrindex(K key, JsonPath jsonPath, JsonValue value)
JsonValue in an array at a given JsonPath and return its index. This
method uses defaults for the start and end indexes, see JsonRangeArgs.DEFAULT_START_INDEX and
JsonRangeArgs.DEFAULT_END_INDEX.Executions<List<Long>> jsonArrinsert(K key, JsonPath jsonPath, int index, JsonValue... values)
JsonValues into the array at a given JsonPath before the provided index, shifting the existing
elements to the rightkey - the key holding the JSON document.jsonPath - the JsonPath pointing to the array inside the document.index - the index before which the new elements will be inserted.values - one or more JsonValues to be inserted.Executions<List<Long>> jsonArrlen(K key, JsonPath jsonPath)
JsonPathkey - the key holding the JSON document.jsonPath - the JsonPath pointing to the array inside the document.Executions<List<Long>> jsonArrlen(K key)
JsonPath.ROOT_PATHkey - the key holding the JSON document.Executions<List<JsonValue>> jsonArrpop(K key, JsonPath jsonPath, int index)
key - the key holding the JSON document.jsonPath - the JsonPath pointing to the array inside the document.index - the index of the element to be removed. Default is -1, meaning the last element. Out-of-range indexes round
to their respective array ends. Popping an empty array returns null.Executions<List<JsonValue>> jsonArrpop(K key, JsonPath jsonPath)
key - the key holding the JSON document.jsonPath - the JsonPath pointing to the array inside the document.Executions<List<JsonValue>> jsonArrpop(K key)
JsonValue at index -1 (last element) in the array at the JsonPath.ROOT_PATHkey - the key holding the JSON document.Executions<List<Long>> jsonArrtrim(K key, JsonPath jsonPath, JsonRangeArgs range)
JsonPath so that it contains only the specified inclusive range of elements. All
elements with indexes smaller than the start range and all elements with indexes bigger than the end range are trimmed.
Behavior as of RedisJSON v2.0:
key - the key holding the JSON document.jsonPath - the JsonPath pointing to the array inside the document.range - the JsonRangeArgs to trim by.Executions<Long> jsonClear(K key, JsonPath jsonPath)
key - the key holding the JSON document.jsonPath - the JsonPath pointing to the value to clear.Executions<Long> jsonClear(K key)
JsonPath.ROOT_PATHkey - the key holding the JSON document.Executions<Long> jsonDel(K key, JsonPath jsonPath)
JsonPathkey - the key holding the JSON document.jsonPath - the JsonPath pointing to the value to clear.Executions<Long> jsonDel(K key)
JsonPath.ROOT_PATHkey - the key holding the JSON document.Executions<List<JsonValue>> jsonGet(K key, JsonGetArgs options, JsonPath... jsonPaths)
When using a single JSONPath, the root of the matching values is a JSON string with a top-level array of serialized JSON value. In contrast, a legacy path returns a single value.
When using multiple JSONPath arguments, the root of the matching values is a JSON string with a top-level object, with each object value being a top-level array of serialized JSON value. In contrast, if all paths are legacy paths, each object value is a single serialized JSON value. If there are multiple paths that include both legacy path and JSONPath, the returned value conforms to the JSONPath version (an array of values).
key - the key holding the JSON document.options - the JsonGetArgs to use.jsonPaths - the JsonPaths to use to identify the values to get.Executions<List<JsonValue>> jsonGet(K key, JsonPath... jsonPaths)
JsonGetArgs.
When using a single JSONPath, the root of the matching values is a JSON string with a top-level array of serialized JSON value. In contrast, a legacy path returns a single value.
When using multiple JSONPath arguments, the root of the matching values is a JSON string with a top-level object, with each object value being a top-level array of serialized JSON value. In contrast, if all paths are legacy paths, each object value is a single serialized JSON value. If there are multiple paths that include both legacy path and JSONPath, the returned value conforms to the JSONPath version (an array of values).
key - the key holding the JSON document.jsonPaths - the JsonPaths to use to identify the values to get.Executions<String> jsonMerge(K key, JsonPath jsonPath, JsonValue value)
JsonValue with the value matching JsonPath. Consequently, JSON values at matching paths are
updated, deleted, or expanded with new children.
Merging is done according to the following rules per JSON value in the value argument while considering the corresponding original value if it exists:
This command complies with RFC7396 "Json Merge Patch"
Executions<List<JsonValue>> jsonMGet(JsonPath jsonPath, K... keys)
Executions<String> jsonMSet(List<JsonMsetArgs<K,V>> arguments)
JsonMsetArgs
JSON.MSET is atomic, hence, all given additions or updates are either applied or not. It is not possible for clients to see that some keys were updated while others are unchanged.
A JSON value is a hierarchical structure. If you change a value in a specific path - nested values are affected.
arguments - the JsonMsetArgs specifying the values to change.Executions<List<Number>> jsonNumincrby(K key, JsonPath jsonPath, Number number)
JsonPath in the JSON document by the provided increment.Executions<List<V>> jsonObjkeys(K key, JsonPath jsonPath)
JsonPathExecutions<List<V>> jsonObjkeys(K key)
JsonPath.ROOT_PATHkey - the key holding the JSON document.JsonPath.Executions<List<Long>> jsonObjlen(K key, JsonPath jsonPath)
JsonPath and for the provided keykey - the key holding the JSON document.jsonPath - the JsonPath pointing to the value(s) whose key(s) we want to countExecutions<List<Long>> jsonObjlen(K key)
JsonPath.ROOT_PATH and for the provided keykey - the key holding the JSON document.Executions<String> jsonSet(K key, JsonPath jsonPath, JsonValue value, JsonSetArgs options)
JsonPath in the JSON document.
For new Redis keys, the path must be the root. For existing keys, when the entire path exists, the value that it contains is replaced with the JSON value. For existing keys, when the path exists, except for the last element, a new child is added with the JSON value.
Adds a key (with its respective value) to a JSON Object (in a RedisJSON data type key) only if it is the last child in the path, or it is the parent of a new child being added in the path. Optional arguments NX and XX modify this behavior for both new RedisJSON data type keys and the JSON Object keys in them.
key - the key holding the JSON document.jsonPath - the JsonPath pointing to the value(s) where we want to set the value.value - the JsonValue to set.options - the JsonSetArgs the options for setting the value.JsonSetArgs conditions are not met.Executions<String> jsonSet(K key, JsonPath jsonPath, JsonValue value)
JsonPath in the JSON document using defaults for the JsonSetArgs.
For new Redis keys the path must be the root. For existing keys, when the entire path exists, the value that it contains is replaced with the JSON value. For existing keys, when the path exists, except for the last element, a new child is added with the JSON value.
Adds a key (with its respective value) to a JSON Object (in a RedisJSON data type key) only if it is the last child in the path, or it is the parent of a new child being added in the path. Optional arguments NX and XX modify this behavior for both new RedisJSON data type keys and the JSON Object keys in them.
key - the key holding the JSON document.jsonPath - the JsonPath pointing to the value(s) where we want to set the value.value - the JsonValue to set.JsonSetArgs conditions are not met.Executions<List<Long>> jsonStrappend(K key, JsonPath jsonPath, JsonValue value)
JsonPath in the JSON document.Executions<List<Long>> jsonStrappend(K key, JsonValue value)
JsonPath.ROOT_PATH in the JSON document.key - the key holding the JSON document.value - the JsonValue to append.Executions<List<Long>> jsonStrlen(K key, JsonPath jsonPath)
JsonPath in the JSON document.Executions<List<Long>> jsonStrlen(K key)
JsonPath.ROOT_PATH in the JSON document.key - the key holding the JSON document.JsonPath, or null if the value
ath the desired path is not a string.Executions<List<Long>> jsonToggle(K key, JsonPath jsonPath)
JsonPath in the JSON document.key - the key holding the JSON document.jsonPath - the JsonPath pointing to the value(s).Executions<List<JsonType>> jsonType(K key, JsonPath jsonPath)
JsonPath in the JSON document.Executions<List<JsonType>> jsonType(K key)
JsonPath.ROOT_PATH in the JSON document.key - the key holding the JSON document.JsonPathCopyright © 2025 lettuce.io. All rights reserved.