Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -262,11 +262,14 @@ <T> T execute(RedisScript<T> script, RedisSerializer<?> argsSerializer, RedisSer
DataType type(K key);

/**
* Find all keys matching the given {@code pattern}.
*
* @param pattern must not be {@literal null}.
* @return {@literal null} when used in pipeline / transaction.
* @see <a href="https://redis.io/commands/keys">Redis Documentation: KEYS</a>
* Retrieve keys matching the given pattern via {@code KEYS} command.
* <p>
* Note: This command scans the entire keyspace and may cause performance issues
* in production environments. Prefer using {@link #scan(ScanOptions)} for large datasets.
*
* @param pattern key pattern
* @return set of matching keys, or {@literal null} when used in pipeline / transaction
* @see <a href="https://redis.io/commands/keys">Redis KEYS command</a>
*/
@Nullable
Set<K> keys(K pattern);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -637,6 +637,16 @@ public DataType type(K key) {
return doWithKeys(connection -> connection.type(rawKey));
}

/**
* Retrieve keys matching the given pattern via {@code KEYS} command.
* <p>
* Note: This command scans the entire keyspace and may cause performance issues
* in production environments. Prefer using {@link #scan(ScanOptions)} for large datasets.
*
* @param pattern key pattern
* @return set of matching keys
* @see <a href="https://redis.io/commands/keys">Redis KEYS command</a>
*/
@Override
@SuppressWarnings("unchecked")
public Set<K> keys(K pattern) {
Expand Down