Package io.lettuce.core.api.reactive
Interface RedisHashReactiveCommands<K,V>
-
- Type Parameters:
K
- Key type.V
- Value type.
- All Known Subinterfaces:
RedisAdvancedClusterReactiveCommands<K,V>
,RedisClusterPubSubReactiveCommands<K,V>
,RedisClusterReactiveCommands<K,V>
,RedisPubSubReactiveCommands<K,V>
,RedisReactiveCommands<K,V>
- All Known Implementing Classes:
AbstractRedisReactiveCommands
,RedisAdvancedClusterReactiveCommandsImpl
,RedisClusterPubSubReactiveCommandsImpl
,RedisPubSubReactiveCommandsImpl
,RedisReactiveCommandsImpl
,RedisSentinelReactiveCommandsImpl
public interface RedisHashReactiveCommands<K,V>
Reactive executed commands for Hashes (Key-Value pairs).- Since:
- 4.0
- Author:
- Mark Paluch
- Generated class:
- by io.lettuce.apigenerator.CreateReactiveApi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description Mono<Long>
hdel(K key, K... fields)
Delete one or more hash fields.Mono<Boolean>
hexists(K key, K field)
Determine if a hash field exists.Mono<V>
hget(K key, K field)
Get the value of a hash field.Mono<Long>
hgetall(KeyValueStreamingChannel<K,V> channel, K key)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned byhgetall(K)
.Flux<KeyValue<K,V>>
hgetall(K key)
Get all the fields and values in a hash.Mono<Long>
hincrby(K key, K field, long amount)
Increment the integer value of a hash field by the given number.Mono<Double>
hincrbyfloat(K key, K field, double amount)
Increment the float value of a hash field by the given amount.Mono<Long>
hkeys(KeyStreamingChannel<K> channel, K key)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned byhkeys(K)
.Flux<K>
hkeys(K key)
Get all the fields in a hash.Mono<Long>
hlen(K key)
Get the number of fields in a hash.Mono<Long>
hmget(KeyValueStreamingChannel<K,V> channel, K key, K... fields)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned byhmget(K, K...)
.Flux<KeyValue<K,V>>
hmget(K key, K... fields)
Get the values of all the given hash fields.Mono<String>
hmset(K key, Map<K,V> map)
Set multiple hash fields to multiple values.Mono<K>
hrandfield(K key)
Return a random field from the hash stored atkey
.Flux<K>
hrandfield(K key, long count)
Returncount
random fields from the hash stored atkey
.Mono<KeyValue<K,V>>
hrandfieldWithvalues(K key)
Return a random field along its value from the hash stored atkey
.Flux<KeyValue<K,V>>
hrandfieldWithvalues(K key, long count)
Returncount
random fields along their value from the hash stored atkey
.Mono<StreamScanCursor>
hscan(KeyValueStreamingChannel<K,V> channel, K key)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned byhscan(K)
.Mono<StreamScanCursor>
hscan(KeyValueStreamingChannel<K,V> channel, K key, ScanArgs scanArgs)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned byhscan(K)
.Mono<StreamScanCursor>
hscan(KeyValueStreamingChannel<K,V> channel, K key, ScanCursor scanCursor)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned byhscan(K)
.Mono<StreamScanCursor>
hscan(KeyValueStreamingChannel<K,V> channel, K key, ScanCursor scanCursor, ScanArgs scanArgs)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned byhscan(K)
.Mono<MapScanCursor<K,V>>
hscan(K key)
Incrementally iterate hash fields and associated values.Mono<MapScanCursor<K,V>>
hscan(K key, ScanArgs scanArgs)
Incrementally iterate hash fields and associated values.Mono<MapScanCursor<K,V>>
hscan(K key, ScanCursor scanCursor)
Incrementally iterate hash fields and associated values.Mono<MapScanCursor<K,V>>
hscan(K key, ScanCursor scanCursor, ScanArgs scanArgs)
Incrementally iterate hash fields and associated values.Mono<Long>
hset(K key, Map<K,V> map)
Set multiple hash fields to multiple values.Mono<Boolean>
hset(K key, K field, V value)
Set the string value of a hash field.Mono<Boolean>
hsetnx(K key, K field, V value)
Set the value of a hash field, only if the field does not exist.Mono<Long>
hstrlen(K key, K field)
Get the string length of the field value in a hash.Mono<Long>
hvals(ValueStreamingChannel<V> channel, K key)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned byhvals(K)
.Flux<V>
hvals(K key)
Get all the values in a hash.
-
-
-
Method Detail
-
hdel
Mono<Long> hdel(K key, K... fields)
Delete one or more hash fields.- Parameters:
key
- the key.fields
- the field type: key.- Returns:
- Long integer-reply the number of fields that were removed from the hash, not including specified but non existing fields.
-
hexists
Mono<Boolean> hexists(K key, K field)
Determine if a hash field exists.- Parameters:
key
- the key.field
- the field type: key.- Returns:
- Boolean integer-reply specifically:
true
if the hash containsfield
.false
if the hash does not containfield
, orkey
does not exist.
-
hget
Mono<V> hget(K key, K field)
Get the value of a hash field.- Parameters:
key
- the key.field
- the field type: key.- Returns:
- V bulk-string-reply the value associated with
field
, ornull
whenfield
is not present in the hash orkey
does not exist.
-
hincrby
Mono<Long> hincrby(K key, K field, long amount)
Increment the integer value of a hash field by the given number.- Parameters:
key
- the key.field
- the field type: key.amount
- the increment type: long.- Returns:
- Long integer-reply the value at
field
after the increment operation.
-
hincrbyfloat
Mono<Double> hincrbyfloat(K key, K field, double amount)
Increment the float value of a hash field by the given amount.- Parameters:
key
- the key.field
- the field type: key.amount
- the increment type: double.- Returns:
- Double bulk-string-reply the value of
field
after the increment.
-
hgetall
Flux<KeyValue<K,V>> hgetall(K key)
Get all the fields and values in a hash.- Parameters:
key
- the key.- Returns:
- Map<K,V> array-reply list of fields and their values stored in the hash, or an empty list when
key
does not exist.
-
hgetall
@Deprecated Mono<Long> hgetall(KeyValueStreamingChannel<K,V> channel, K key)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned byhgetall(K)
.Stream over all the fields and values in a hash.- Parameters:
channel
- the channel.key
- the key.- Returns:
- Long count of the keys.
-
hkeys
Flux<K> hkeys(K key)
Get all the fields in a hash.- Parameters:
key
- the key.- Returns:
- K array-reply list of fields in the hash, or an empty list when
key
does not exist.
-
hkeys
@Deprecated Mono<Long> hkeys(KeyStreamingChannel<K> channel, K key)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned byhkeys(K)
.Stream over all the fields in a hash.- Parameters:
channel
- the channel.key
- the key.- Returns:
- Long count of the keys.
-
hlen
Mono<Long> hlen(K key)
Get the number of fields in a hash.- Parameters:
key
- the key.- Returns:
- Long integer-reply number of fields in the hash, or
0
whenkey
does not exist.
-
hmget
Flux<KeyValue<K,V>> hmget(K key, K... fields)
Get the values of all the given hash fields.- Parameters:
key
- the key.fields
- the field type: key.- Returns:
- V array-reply list of values associated with the given fields, in the same.
-
hmget
@Deprecated Mono<Long> hmget(KeyValueStreamingChannel<K,V> channel, K key, K... fields)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned byhmget(K, K...)
.Stream over the values of all the given hash fields.- Parameters:
channel
- the channel.key
- the key.fields
- the fields.- Returns:
- Long count of the keys.
-
hmset
Mono<String> hmset(K key, Map<K,V> map)
Set multiple hash fields to multiple values.- Parameters:
key
- the key.map
- the hash to apply.- Returns:
- String simple-string-reply.
-
hrandfield
Mono<K> hrandfield(K key)
Return a random field from the hash stored atkey
.- Parameters:
key
- the key.- Returns:
- hash field name.
- Since:
- 6.1
-
hrandfield
Flux<K> hrandfield(K key, long count)
Returncount
random fields from the hash stored atkey
.- Parameters:
key
- the key.count
- the number of fields to return. If the provided count argument is positive, return an array of distinct fields.- Returns:
- array-reply list of field names.
- Since:
- 6.1
-
hrandfieldWithvalues
Mono<KeyValue<K,V>> hrandfieldWithvalues(K key)
Return a random field along its value from the hash stored atkey
.- Parameters:
key
- the key.count
- the number of fields to return. If the provided count argument is positive, return an array of distinct fields.- Returns:
- array-reply the key and value.
- Since:
- 6.1
-
hrandfieldWithvalues
Flux<KeyValue<K,V>> hrandfieldWithvalues(K key, long count)
Returncount
random fields along their value from the hash stored atkey
.- Parameters:
key
- the key.count
- the number of fields to return. If the provided count argument is positive, return an array of distinct fields.- Returns:
- array-reply the keys and values.
- Since:
- 6.1
-
hscan
Mono<MapScanCursor<K,V>> hscan(K key)
Incrementally iterate hash fields and associated values.- Parameters:
key
- the key.- Returns:
- MapScanCursor<K, V> map scan cursor.
-
hscan
Mono<MapScanCursor<K,V>> hscan(K key, ScanArgs scanArgs)
Incrementally iterate hash fields and associated values.- Parameters:
key
- the key.scanArgs
- scan arguments.- Returns:
- MapScanCursor<K, V> map scan cursor.
-
hscan
Mono<MapScanCursor<K,V>> hscan(K key, ScanCursor scanCursor, ScanArgs scanArgs)
Incrementally iterate hash fields and associated values.- Parameters:
key
- the key.scanCursor
- cursor to resume from a previous scan, must not benull
.scanArgs
- scan arguments.- Returns:
- MapScanCursor<K, V> map scan cursor.
-
hscan
Mono<MapScanCursor<K,V>> hscan(K key, ScanCursor scanCursor)
Incrementally iterate hash fields and associated values.- Parameters:
key
- the key.scanCursor
- cursor to resume from a previous scan, must not benull
.- Returns:
- MapScanCursor<K, V> map scan cursor.
-
hscan
@Deprecated Mono<StreamScanCursor> hscan(KeyValueStreamingChannel<K,V> channel, K key)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned byhscan(K)
.Incrementally iterate hash fields and associated values.- Parameters:
channel
- streaming channel that receives a call for every key-value pair.key
- the key.- Returns:
- StreamScanCursor scan cursor.
-
hscan
@Deprecated Mono<StreamScanCursor> hscan(KeyValueStreamingChannel<K,V> channel, K key, ScanArgs scanArgs)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned byhscan(K)
.Incrementally iterate hash fields and associated values.- Parameters:
channel
- streaming channel that receives a call for every key-value pair.key
- the key.scanArgs
- scan arguments.- Returns:
- StreamScanCursor scan cursor.
-
hscan
@Deprecated Mono<StreamScanCursor> hscan(KeyValueStreamingChannel<K,V> channel, K key, ScanCursor scanCursor, ScanArgs scanArgs)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned byhscan(K)
.Incrementally iterate hash fields and associated values.- Parameters:
channel
- streaming channel that receives a call for every key-value pair.key
- the key.scanCursor
- cursor to resume from a previous scan, must not benull
.scanArgs
- scan arguments.- Returns:
- StreamScanCursor scan cursor.
-
hscan
@Deprecated Mono<StreamScanCursor> hscan(KeyValueStreamingChannel<K,V> channel, K key, ScanCursor scanCursor)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned byhscan(K)
.Incrementally iterate hash fields and associated values.- Parameters:
channel
- streaming channel that receives a call for every key-value pair.key
- the key.scanCursor
- cursor to resume from a previous scan, must not benull
.- Returns:
- StreamScanCursor scan cursor.
-
hset
Mono<Boolean> hset(K key, K field, V value)
Set the string value of a hash field.- Parameters:
key
- the key.field
- the field type: key.value
- the value.- Returns:
- Boolean integer-reply specifically:
true
iffield
is a new field in the hash andvalue
was set.false
iffield
already exists in the hash and the value was updated.
-
hset
Mono<Long> hset(K key, Map<K,V> map)
Set multiple hash fields to multiple values.- Parameters:
key
- the key of the hash.map
- the field/value pairs to update.- Returns:
- Long integer-reply: the number of fields that were added.
- Since:
- 5.3
-
hsetnx
Mono<Boolean> hsetnx(K key, K field, V value)
Set the value of a hash field, only if the field does not exist.- Parameters:
key
- the key.field
- the field type: key.value
- the value.- Returns:
- Boolean integer-reply specifically:
1
iffield
is a new field in the hash andvalue
was set.0
iffield
already exists in the hash and no operation was performed.
-
hstrlen
Mono<Long> hstrlen(K key, K field)
Get the string length of the field value in a hash.- Parameters:
key
- the key.field
- the field type: key.- Returns:
- Long integer-reply the string length of the
field
value, or0
whenfield
is not present in the hash orkey
does not exist at all.
-
hvals
Flux<V> hvals(K key)
Get all the values in a hash.- Parameters:
key
- the key.- Returns:
- V array-reply list of values in the hash, or an empty list when
key
does not exist.
-
hvals
@Deprecated Mono<Long> hvals(ValueStreamingChannel<V> channel, K key)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned byhvals(K)
.Stream over all the values in a hash.- Parameters:
channel
- streaming channel that receives a call for every value.key
- the key.- Returns:
- Long count of the keys.
-
-