Interface RedisJsonCommands

All Known Subinterfaces:
DefaultedRedisClusterConnection, DefaultedRedisConnection, RedisClusterConnection, RedisCommands, RedisConnection, RedisConnectionUtils.RedisConnectionProxy, StringRedisConnection
All Known Implementing Classes:
AbstractRedisConnection, DefaultStringRedisConnection, JedisClusterConnection, JedisConnection, LettuceClusterConnection, LettuceConnection

@NullUnmarked public interface RedisJsonCommands
JSON commands supported by Redis.

Many methods in this interface return a List rather than a single value. This is because JSONPath expressions can match multiple values within a document, and each match produces its own result. For example, given the following document stored at key user:1:

{
  "groups": [
    { "name": "admins",  "roles": ["read", "write", "delete"] },
    { "name": "editors", "roles": ["read", "write"] },
    { "name": "viewers", "roles": ["read"] }
  ]
}
Calling JSON.ARRINDEX user:1 $.groups[*].roles "write" returns:
[1, 1, -1]
The path $.groups[*].roles matches three arrays, so the result contains one entry per match: index 1 for the first two arrays (where "write" appears at position 1) and -1 for the third array (where "write" is not found).
Since:
4.2
Author:
Yordan Tsintsov, Mark Paluch
See Also: