Interface ReactiveHashCommands
- All Known Subinterfaces:
ReactiveClusterHashCommands
public interface ReactiveHashCommands
Redis Hash commands executed using reactive infrastructure.
- Since:
- 2.0
- Author:
- Christoph Strobl, Mark Paluch
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
static class
HEXISTSReactiveRedisConnection.Command
.static class
static class
HRANDFIELDReactiveRedisConnection.Command
.static class
static class
-
Method Summary
Modifier and TypeMethodDescriptiondefault reactor.core.publisher.Mono<Boolean>
hDel
(ByteBuffer key, ByteBuffer field) Delete given hash field.default reactor.core.publisher.Mono<Long>
hDel
(ByteBuffer key, Collection<ByteBuffer> fields) Delete given hash fields.reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveHashCommands.HDelCommand,
Long>> hDel
(org.reactivestreams.Publisher<ReactiveHashCommands.HDelCommand> commands) Delete given hash fields.default reactor.core.publisher.Mono<Boolean>
hExists
(ByteBuffer key, ByteBuffer field) Determine if given hash field exists.reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveHashCommands.HExistsCommand>>
hExists
(org.reactivestreams.Publisher<ReactiveHashCommands.HExistsCommand> commands) Determine if given hash field exists.default reactor.core.publisher.Mono<ByteBuffer>
hGet
(ByteBuffer key, ByteBuffer field) Get value for given field from hash at key.default reactor.core.publisher.Flux<Map.Entry<ByteBuffer,
ByteBuffer>> hGetAll
(ByteBuffer key) Get entire hash stored at key.reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,
reactor.core.publisher.Flux<Map.Entry<ByteBuffer, ByteBuffer>>>> hGetAll
(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> commands) Get entire hash stored at key.default reactor.core.publisher.Flux<ByteBuffer>
hKeys
(ByteBuffer key) Get key set (fields) of hash at key.reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,
reactor.core.publisher.Flux<ByteBuffer>>> hKeys
(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> commands) Get key set (fields) of hash at key.default reactor.core.publisher.Mono<Long>
hLen
(ByteBuffer key) Get size of hash at key.reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveRedisConnection.KeyCommand,
Long>> hLen
(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> commands) Get size of hash at key.default reactor.core.publisher.Mono<List<ByteBuffer>>
hMGet
(ByteBuffer key, Collection<ByteBuffer> fields) Get values for given fields from hash at key.reactor.core.publisher.Flux<ReactiveRedisConnection.MultiValueResponse<ReactiveHashCommands.HGetCommand,
ByteBuffer>> hMGet
(org.reactivestreams.Publisher<ReactiveHashCommands.HGetCommand> commands) Get values for given fields from hash at key.default reactor.core.publisher.Mono<Boolean>
hMSet
(ByteBuffer key, Map<ByteBuffer, ByteBuffer> fieldValueMap) Set multiple hash fields to multiple values using data provided in fieldValueMap.default reactor.core.publisher.Mono<ByteBuffer>
hRandField
(ByteBuffer key) Return a random field from the hash stored atkey
.default reactor.core.publisher.Flux<ByteBuffer>
hRandField
(ByteBuffer key, long count) Return a random field from the hash stored atkey
.reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveHashCommands.HRandFieldCommand,
reactor.core.publisher.Flux<ByteBuffer>>> hRandField
(org.reactivestreams.Publisher<ReactiveHashCommands.HRandFieldCommand> commands) Get random fields of hash at key.default reactor.core.publisher.Mono<Map.Entry<ByteBuffer,
ByteBuffer>> Return a random field from the hash along with its value stored atkey
.default reactor.core.publisher.Flux<Map.Entry<ByteBuffer,
ByteBuffer>> hRandFieldWithValues
(ByteBuffer key, long count) Return a random field from the hash along with its value stored atkey
.reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveHashCommands.HRandFieldCommand,
reactor.core.publisher.Flux<Map.Entry<ByteBuffer, ByteBuffer>>>> hRandFieldWithValues
(org.reactivestreams.Publisher<ReactiveHashCommands.HRandFieldCommand> commands) Get random fields along their values of hash at key.default reactor.core.publisher.Flux<Map.Entry<ByteBuffer,
ByteBuffer>> hScan
(ByteBuffer key) Use aFlux
to iterate over entries in the hash atkey
.default reactor.core.publisher.Flux<Map.Entry<ByteBuffer,
ByteBuffer>> hScan
(ByteBuffer key, ScanOptions options) reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,
reactor.core.publisher.Flux<Map.Entry<ByteBuffer, ByteBuffer>>>> hScan
(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyScanCommand> commands) Use aFlux
to iterate over entries in the hash atkey
.default reactor.core.publisher.Mono<Boolean>
hSet
(ByteBuffer key, ByteBuffer field, ByteBuffer value) Set the value of a hash field.reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveHashCommands.HSetCommand>>
hSet
(org.reactivestreams.Publisher<ReactiveHashCommands.HSetCommand> commands) Set the value of a hash field.default reactor.core.publisher.Mono<Boolean>
hSetNX
(ByteBuffer key, ByteBuffer field, ByteBuffer value) Set the value of a hash field.default reactor.core.publisher.Mono<Long>
hStrLen
(ByteBuffer key, ByteBuffer field) Get the length of the value associated withfield
.reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveHashCommands.HStrLenCommand,
Long>> hStrLen
(org.reactivestreams.Publisher<ReactiveHashCommands.HStrLenCommand> commands) Get the length of the value associated withfield
.default reactor.core.publisher.Flux<ByteBuffer>
hVals
(ByteBuffer key) Get entry set (values) of hash at key.reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,
reactor.core.publisher.Flux<ByteBuffer>>> hVals
(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> commands) Get entry set (values) of hash at key.
-
Method Details
-
hSet
default reactor.core.publisher.Mono<Boolean> hSet(ByteBuffer key, ByteBuffer field, ByteBuffer value) Set the value of a hash field.- Parameters:
key
- must not be null.field
- must not be null.value
- must not be null.- Returns:
- See Also:
-
hSetNX
default reactor.core.publisher.Mono<Boolean> hSetNX(ByteBuffer key, ByteBuffer field, ByteBuffer value) Set the value of a hash field.- Parameters:
key
- must not be null.field
- must not be null.value
- must not be null.- Returns:
- See Also:
-
hMSet
default reactor.core.publisher.Mono<Boolean> hMSet(ByteBuffer key, Map<ByteBuffer, ByteBuffer> fieldValueMap) Set multiple hash fields to multiple values using data provided in fieldValueMap.- Parameters:
key
- must not be null.fieldValueMap
- must not be null.- Returns:
- See Also:
-
hSet
reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveHashCommands.HSetCommand>> hSet(org.reactivestreams.Publisher<ReactiveHashCommands.HSetCommand> commands) Set the value of a hash field.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
hGet
Get value for given field from hash at key.- Parameters:
key
- must not be null.field
- must not be null.- Returns:
- See Also:
-
hMGet
default reactor.core.publisher.Mono<List<ByteBuffer>> hMGet(ByteBuffer key, Collection<ByteBuffer> fields) Get values for given fields from hash at key. Values are in the order of the requested keys. Absent field values are represented using null in the resultingList
.- Parameters:
key
- must not be null.fields
- must not be null.- Returns:
- See Also:
-
hMGet
reactor.core.publisher.Flux<ReactiveRedisConnection.MultiValueResponse<ReactiveHashCommands.HGetCommand,ByteBuffer>> hMGet(org.reactivestreams.Publisher<ReactiveHashCommands.HGetCommand> commands) Get values for given fields from hash at key. Values are in the order of the requested keys. Absent field values are represented using null in the resultingList
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
hExists
Determine if given hash field exists.- Parameters:
key
- must not be null.field
- must not be null.- Returns:
- See Also:
-
hExists
reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveHashCommands.HExistsCommand>> hExists(org.reactivestreams.Publisher<ReactiveHashCommands.HExistsCommand> commands) Determine if given hash field exists.- Parameters:
commands
-- Returns:
- See Also:
-
hDel
Delete given hash field.- Parameters:
key
- must not be null.field
- must not be null.- Returns:
- See Also:
-
hDel
Delete given hash fields.- Parameters:
key
- must not be null.fields
- must not be null.- Returns:
- See Also:
-
hDel
reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveHashCommands.HDelCommand,Long>> hDel(org.reactivestreams.Publisher<ReactiveHashCommands.HDelCommand> commands) Delete given hash fields.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
hLen
Get size of hash at key.- Parameters:
key
- must not be null.- Returns:
- See Also:
-
hLen
reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveRedisConnection.KeyCommand,Long>> hLen(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> commands) Get size of hash at key.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
hRandField
Return a random field from the hash stored atkey
.- Parameters:
key
- must not be null.- Returns:
- Since:
- 2.6
- See Also:
-
hRandFieldWithValues
default reactor.core.publisher.Mono<Map.Entry<ByteBuffer,ByteBuffer>> hRandFieldWithValues(ByteBuffer key) Return a random field from the hash along with its value stored atkey
.- Parameters:
key
- must not be null.- Returns:
- Since:
- 2.6
- See Also:
-
hRandField
Return a random field from the hash stored atkey
. If the providedcount
argument is positive, return a list of distinct fields, capped either atcount
or the hash size. Ifcount
is negative, the behavior changes and the command is allowed to return the same field multiple times. In this case, the number of returned fields is the absolute value of the specified count.- Parameters:
key
- must not be null.count
- number of fields to return.- Returns:
- Since:
- 2.6
- See Also:
-
hRandFieldWithValues
default reactor.core.publisher.Flux<Map.Entry<ByteBuffer,ByteBuffer>> hRandFieldWithValues(ByteBuffer key, long count) Return a random field from the hash along with its value stored atkey
. If the providedcount
argument is positive, return a list of distinct fields, capped either atcount
or the hash size. Ifcount
is negative, the behavior changes and the command is allowed to return the same field multiple times. In this case, the number of returned fields is the absolute value of the specified count.- Parameters:
key
- must not be null.count
- number of fields to return.- Returns:
- null if key does not exist or when used in pipeline / transaction.
- Since:
- 2.6
- See Also:
-
hRandField
reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveHashCommands.HRandFieldCommand,reactor.core.publisher.Flux<ByteBuffer>>> hRandField(org.reactivestreams.Publisher<ReactiveHashCommands.HRandFieldCommand> commands) Get random fields of hash at key.- Parameters:
commands
- must not be null.- Returns:
- Since:
- 2.6
- See Also:
-
hRandFieldWithValues
reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveHashCommands.HRandFieldCommand,reactor.core.publisher.Flux<Map.Entry<ByteBuffer, hRandFieldWithValuesByteBuffer>>>> (org.reactivestreams.Publisher<ReactiveHashCommands.HRandFieldCommand> commands) Get random fields along their values of hash at key.- Parameters:
commands
- must not be null.- Returns:
- Since:
- 2.6
- See Also:
-
hKeys
Get key set (fields) of hash at key.- Parameters:
key
- must not be null.- Returns:
- See Also:
-
hKeys
reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,reactor.core.publisher.Flux<ByteBuffer>>> hKeys(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> commands) Get key set (fields) of hash at key.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
hVals
Get entry set (values) of hash at key.- Parameters:
key
- must not be null.- Returns:
- See Also:
-
hVals
reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,reactor.core.publisher.Flux<ByteBuffer>>> hVals(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> commands) Get entry set (values) of hash at key.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
hGetAll
Get entire hash stored at key.- Parameters:
key
- must not be null.- Returns:
- See Also:
-
hGetAll
reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,reactor.core.publisher.Flux<Map.Entry<ByteBuffer, hGetAllByteBuffer>>>> (org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> commands) Get entire hash stored at key.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
hScan
Use aFlux
to iterate over entries in the hash atkey
. The resultingFlux
acts as a cursor and issuesHSCAN
commands itself as long as the subscriber signals demand.- Parameters:
key
- must not be null.- Returns:
- the
Flux
emittingentries
one by one. - Throws:
IllegalArgumentException
- in case the given key is null.- Since:
- 2.1
- See Also:
-
hScan
default reactor.core.publisher.Flux<Map.Entry<ByteBuffer,ByteBuffer>> hScan(ByteBuffer key, ScanOptions options) Use aFlux
to iterate over entries in the hash atkey
givenScanOptions
. The resultingFlux
acts as a cursor and issuesHSCAN
commands itself as long as the subscriber signals demand.- Parameters:
key
- must not be null.options
- must not be null. UseScanOptions.NONE
instead.- Returns:
- the
Flux
emitting the rawentries
one by one. - Throws:
IllegalArgumentException
- in case one of the required arguments is null.- Since:
- 2.1
- See Also:
-
hScan
reactor.core.publisher.Flux<ReactiveRedisConnection.CommandResponse<ReactiveRedisConnection.KeyCommand,reactor.core.publisher.Flux<Map.Entry<ByteBuffer, hScanByteBuffer>>>> (org.reactivestreams.Publisher<ReactiveRedisConnection.KeyScanCommand> commands) Use aFlux
to iterate over entries in the hash atkey
. The resultingFlux
acts as a cursor and issuesHSCAN
commands itself as long as the subscriber signals demand.- Parameters:
commands
- must not be null.- Returns:
- the
Flux
emittingReactiveRedisConnection.CommandResponse
one by one. - Since:
- 2.1
- See Also:
-
hStrLen
Get the length of the value associated withfield
. If either thekey
or thefield
do not exist,0
is emitted.- Parameters:
key
- must not be null.field
- must not be null.- Returns:
- never null.
- Since:
- 2.1
-
hStrLen
reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveHashCommands.HStrLenCommand,Long>> hStrLen(org.reactivestreams.Publisher<ReactiveHashCommands.HStrLenCommand> commands) Get the length of the value associated withfield
. If either thekey
or thefield
do not exist,0
is emitted.- Parameters:
commands
- must not be null.- Returns:
- never null.
- Since:
- 2.1
-