Interface ReactiveStringCommands
- All Known Subinterfaces:
ReactiveClusterStringCommands
public interface ReactiveStringCommands
Redis String commands executed using reactive infrastructure.
- Since:
- 2.0
- Author:
- Christoph Strobl, Mark Paluch
-
Nested Class Summary
Modifier and TypeInterfaceDescriptionstatic class
APPEND
command parameters.static class
BITCOUNT
command parameters.static class
BITFIELD
command parameters.static class
BITOP
command parameters.static class
static class
GETBIT
command parameters.static class
ReactiveRedisConnection.Command
forGETEX
.static class
MSET
command parameters.static class
SETBIT
command parameters.static class
SET
command parameters.static class
SETRANGE
command parameters. -
Method Summary
Modifier and TypeMethodDescriptiondefault reactor.core.publisher.Mono<Long>
append
(ByteBuffer key, ByteBuffer value) Append a value to key.reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveStringCommands.AppendCommand,
Long>> append
(org.reactivestreams.Publisher<ReactiveStringCommands.AppendCommand> commands) default reactor.core.publisher.Mono<Long>
bitCount
(ByteBuffer key) Count the number of set bits (population counting) in value stored at key.default reactor.core.publisher.Mono<Long>
bitCount
(ByteBuffer key, long start, long end) Count the number of set bits (population counting) of value stored at key between start and end.reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveStringCommands.BitCountCommand,
Long>> bitCount
(org.reactivestreams.Publisher<ReactiveStringCommands.BitCountCommand> commands) Count the number of set bits (population counting) of value stored at key between start and end.bitField
(ByteBuffer key, BitFieldSubCommands subCommands) Get / Manipulate specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset stored at a givenkey
.reactor.core.publisher.Flux<ReactiveRedisConnection.MultiValueResponse<ReactiveStringCommands.BitFieldCommand,
Long>> bitField
(org.reactivestreams.Publisher<ReactiveStringCommands.BitFieldCommand> commands) Get / Manipulate specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset stored at a givenkey
.default reactor.core.publisher.Mono<Long>
bitOp
(Collection<ByteBuffer> keys, RedisStringCommands.BitOperation bitOp, ByteBuffer destination) Perform bitwise operations between strings.reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveStringCommands.BitOpCommand,
Long>> bitOp
(org.reactivestreams.Publisher<ReactiveStringCommands.BitOpCommand> commands) Perform bitwise operations between strings.default reactor.core.publisher.Mono<Long>
bitPos
(ByteBuffer key, boolean bit) Return the position of the first bit set to givenbit
in a string.default reactor.core.publisher.Mono<Long>
bitPos
(ByteBuffer key, boolean bit, org.springframework.data.domain.Range<Long> range) Return the position of the first bit set to givenbit
in a string.reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveStringCommands.BitPosCommand,
Long>> bitPos
(org.reactivestreams.Publisher<ReactiveStringCommands.BitPosCommand> commands) Emmit the the position of the first bit set to givenbit
in a string.default reactor.core.publisher.Mono<ByteBuffer>
get
(ByteBuffer key) Get single element stored at key.reactor.core.publisher.Flux<ReactiveRedisConnection.ByteBufferResponse<ReactiveRedisConnection.KeyCommand>>
get
(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> keys) Get elements one by one.default reactor.core.publisher.Mono<Boolean>
getBit
(ByteBuffer key, long offset) Get the bit value at offset of value at key.reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveStringCommands.GetBitCommand>>
getBit
(org.reactivestreams.Publisher<ReactiveStringCommands.GetBitCommand> commands) Get the bit value at offset of value at key.default reactor.core.publisher.Mono<ByteBuffer>
getDel
(ByteBuffer key) Return the value atkey
and delete the key.reactor.core.publisher.Flux<ReactiveRedisConnection.ByteBufferResponse<ReactiveRedisConnection.KeyCommand>>
getDel
(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> commands) Return the value atkey
and delete the key.default reactor.core.publisher.Mono<ByteBuffer>
getEx
(ByteBuffer key, Expiration expiration) Return the value atkey
and expire the key by applyingExpiration
.reactor.core.publisher.Flux<ReactiveRedisConnection.ByteBufferResponse<ReactiveStringCommands.GetExCommand>>
getEx
(org.reactivestreams.Publisher<ReactiveStringCommands.GetExCommand> commands) Return the value atkey
and expire the key by applyingExpiration
.default reactor.core.publisher.Mono<ByteBuffer>
getRange
(ByteBuffer key, long start, long end) Get a substring of value of key between start and end.reactor.core.publisher.Flux<ReactiveRedisConnection.ByteBufferResponse<ReactiveRedisConnection.RangeCommand>>
getRange
(org.reactivestreams.Publisher<ReactiveRedisConnection.RangeCommand> commands) Get a substring of value of key between start and end.default reactor.core.publisher.Mono<ByteBuffer>
getSet
(ByteBuffer key, ByteBuffer value) Set value for key and return the existing value.reactor.core.publisher.Flux<ReactiveRedisConnection.ByteBufferResponse<ReactiveStringCommands.SetCommand>>
getSet
(org.reactivestreams.Publisher<ReactiveStringCommands.SetCommand> commands) Set value for key and return the existing value one by one.default reactor.core.publisher.Mono<List<ByteBuffer>>
mGet
(List<ByteBuffer> keys) Get multiple values in one batch.reactor.core.publisher.Flux<ReactiveRedisConnection.MultiValueResponse<List<ByteBuffer>,
ByteBuffer>> mGet
(org.reactivestreams.Publisher<List<ByteBuffer>> keysets) Get multiple values at for keysets in batches.default reactor.core.publisher.Mono<Boolean>
mSet
(Map<ByteBuffer, ByteBuffer> keyValuePairs) Set multiple keys to multiple values using key-value pairs provided in tuple.reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveStringCommands.MSetCommand>>
mSet
(org.reactivestreams.Publisher<ReactiveStringCommands.MSetCommand> commands) Set multiple keys to multiple values using key-value pairs provided in commands.default reactor.core.publisher.Mono<Boolean>
mSetNX
(Map<ByteBuffer, ByteBuffer> keyValuePairs) Set multiple keys to multiple values using key-value pairs provided in keyValuePairs only if the provided key does not exist.reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveStringCommands.MSetCommand>>
mSetNX
(org.reactivestreams.Publisher<ReactiveStringCommands.MSetCommand> source) Set multiple keys to multiple values using key-value pairs provided in tuples only if the provided key does not exist.default reactor.core.publisher.Mono<Boolean>
pSetEX
(ByteBuffer key, ByteBuffer value, Expiration expireTimeout) Set key value pair andExpiration
.reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveStringCommands.SetCommand>>
pSetEX
(org.reactivestreams.Publisher<ReactiveStringCommands.SetCommand> commands) Set key value pairs andExpiration
.default reactor.core.publisher.Mono<Boolean>
set
(ByteBuffer key, ByteBuffer value) Set value for key.default reactor.core.publisher.Mono<Boolean>
set
(ByteBuffer key, ByteBuffer value, Expiration expiration, RedisStringCommands.SetOption option) Set value for key with expiration and options.reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveStringCommands.SetCommand>>
set
(org.reactivestreams.Publisher<ReactiveStringCommands.SetCommand> commands) Set each and every item separately by invokingReactiveStringCommands.SetCommand
.default reactor.core.publisher.Mono<Boolean>
setBit
(ByteBuffer key, long offset, boolean value) Sets the bit at offset in value stored at key and return the original value.reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveStringCommands.SetBitCommand>>
setBit
(org.reactivestreams.Publisher<ReactiveStringCommands.SetBitCommand> commands) Sets the bit at offset in value stored at key and return the original value.default reactor.core.publisher.Mono<Boolean>
setEX
(ByteBuffer key, ByteBuffer value, Expiration expireTimeout) Set key value pair andExpiration
.reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveStringCommands.SetCommand>>
setEX
(org.reactivestreams.Publisher<ReactiveStringCommands.SetCommand> commands) Set key value pairs andExpiration
.default reactor.core.publisher.Mono<Boolean>
setNX
(ByteBuffer key, ByteBuffer value) Set value for key, only if key does not exist.reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveStringCommands.SetCommand>>
setNX
(org.reactivestreams.Publisher<ReactiveStringCommands.SetCommand> values) Set key value pairs, only if key does not exist.default reactor.core.publisher.Mono<Long>
setRange
(ByteBuffer key, ByteBuffer value, long offset) Overwrite parts of key starting at the specified offset with given value.reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveStringCommands.SetRangeCommand,
Long>> setRange
(org.reactivestreams.Publisher<ReactiveStringCommands.SetRangeCommand> commands) Overwrite parts ofReactiveRedisConnection.KeyCommand.key
starting at the specified offset with givenReactiveStringCommands.SetRangeCommand.value
.default reactor.core.publisher.Mono<Long>
strLen
(ByteBuffer key) Get the length of the value stored at key.reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveRedisConnection.KeyCommand,
Long>> strLen
(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> keys) Get the length of the value stored at key.
-
Method Details
-
set
Set value for key.- Parameters:
key
- must not be null.value
- must not be null.- Returns:
- See Also:
-
set
default reactor.core.publisher.Mono<Boolean> set(ByteBuffer key, ByteBuffer value, Expiration expiration, RedisStringCommands.SetOption option) Set value for key with expiration and options.- Parameters:
key
- must not be null.value
- must not be null.expiration
- must not be null. UseExpiration.persistent()
for no expiration time orExpiration.keepTtl()
to keep the existing.option
- must not be null.- Returns:
- See Also:
-
set
reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveStringCommands.SetCommand>> set(org.reactivestreams.Publisher<ReactiveStringCommands.SetCommand> commands) Set each and every item separately by invokingReactiveStringCommands.SetCommand
.- Parameters:
commands
- must not be null.- Returns:
Flux
ofReactiveRedisConnection.BooleanResponse
holding theReactiveStringCommands.SetCommand
along with the command result.- See Also:
-
get
Get single element stored at key.- Parameters:
key
- must not be null.- Returns:
Mono.empty()
in case key does not exist.- See Also:
-
get
reactor.core.publisher.Flux<ReactiveRedisConnection.ByteBufferResponse<ReactiveRedisConnection.KeyCommand>> get(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> keys) Get elements one by one.- Parameters:
keys
- must not be null.- Returns:
Flux
ofReactiveRedisConnection.ByteBufferResponse
holding the key to get along with the value retrieved.- See Also:
-
getDel
Return the value atkey
and delete the key.- Parameters:
key
- must not be null.- Returns:
Mono.empty()
in case key does not exist.- Since:
- 2.6
- See Also:
-
getDel
reactor.core.publisher.Flux<ReactiveRedisConnection.ByteBufferResponse<ReactiveRedisConnection.KeyCommand>> getDel(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> commands) Return the value atkey
and delete the key.- Parameters:
commands
- must not be null.- Returns:
Flux
ofReactiveRedisConnection.ByteBufferResponse
holding the key to get along with the value retrieved.- Since:
- 2.6
- See Also:
-
getEx
Return the value atkey
and expire the key by applyingExpiration
.- Parameters:
key
- must not be null.expiration
- must not be null.- Returns:
Mono.empty()
in case key does not exist.- Since:
- 2.6
- See Also:
-
getEx
reactor.core.publisher.Flux<ReactiveRedisConnection.ByteBufferResponse<ReactiveStringCommands.GetExCommand>> getEx(org.reactivestreams.Publisher<ReactiveStringCommands.GetExCommand> commands) Return the value atkey
and expire the key by applyingExpiration
.- Parameters:
commands
- must not be null.- Returns:
Flux
ofReactiveRedisConnection.ByteBufferResponse
holding the key to get along with the value retrieved.- Since:
- 2.6
- See Also:
-
getSet
Set value for key and return the existing value.- Parameters:
key
- must not be null.value
- must not be null.- Returns:
Mono.empty()
if key did not exist.- See Also:
-
getSet
reactor.core.publisher.Flux<ReactiveRedisConnection.ByteBufferResponse<ReactiveStringCommands.SetCommand>> getSet(org.reactivestreams.Publisher<ReactiveStringCommands.SetCommand> commands) Set value for key and return the existing value one by one.- Parameters:
commands
- must not be null.- Returns:
Flux
ofReactiveRedisConnection.ByteBufferResponse
holding theReactiveStringCommands.SetCommand
along with the previously existing value.- See Also:
-
mGet
Get multiple values in one batch. Values are in the order of the requested keys. Absent field values are represented usingnull
in the resultingList
.- Parameters:
keys
- must not be null.- Returns:
- See Also:
-
mGet
reactor.core.publisher.Flux<ReactiveRedisConnection.MultiValueResponse<List<ByteBuffer>,ByteBuffer>> mGet(org.reactivestreams.Publisher<List<ByteBuffer>> keysets) Get multiple values at for keysets in batches. Values are in the order of the requested keys. Absent field values are represented usingnull
in the resultingList
.- Parameters:
keysets
- must not be null.- Returns:
- See Also:
-
setNX
Set value for key, only if key does not exist.- Parameters:
key
- must not be null.value
- must not be null.- Returns:
- See Also:
-
setNX
reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveStringCommands.SetCommand>> setNX(org.reactivestreams.Publisher<ReactiveStringCommands.SetCommand> values) Set key value pairs, only if key does not exist.- Parameters:
values
- must not be null.- Returns:
- See Also:
-
setEX
default reactor.core.publisher.Mono<Boolean> setEX(ByteBuffer key, ByteBuffer value, Expiration expireTimeout) Set key value pair andExpiration
.- Parameters:
key
- must not be null.value
- must not be null.expireTimeout
- must not be null.- Returns:
- See Also:
-
setEX
reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveStringCommands.SetCommand>> setEX(org.reactivestreams.Publisher<ReactiveStringCommands.SetCommand> commands) Set key value pairs andExpiration
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
pSetEX
default reactor.core.publisher.Mono<Boolean> pSetEX(ByteBuffer key, ByteBuffer value, Expiration expireTimeout) Set key value pair andExpiration
.- Parameters:
key
- must not be null.value
- must not be null.expireTimeout
- must not be null.- Returns:
- See Also:
-
pSetEX
reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveStringCommands.SetCommand>> pSetEX(org.reactivestreams.Publisher<ReactiveStringCommands.SetCommand> commands) Set key value pairs andExpiration
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
mSet
Set multiple keys to multiple values using key-value pairs provided in tuple.- Parameters:
keyValuePairs
- must not be null.- Returns:
- See Also:
-
mSet
reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveStringCommands.MSetCommand>> mSet(org.reactivestreams.Publisher<ReactiveStringCommands.MSetCommand> commands) Set multiple keys to multiple values using key-value pairs provided in commands.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
mSetNX
Set multiple keys to multiple values using key-value pairs provided in keyValuePairs only if the provided key does not exist.- Parameters:
keyValuePairs
- must not be null.- Returns:
- See Also:
-
mSetNX
reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveStringCommands.MSetCommand>> mSetNX(org.reactivestreams.Publisher<ReactiveStringCommands.MSetCommand> source) Set multiple keys to multiple values using key-value pairs provided in tuples only if the provided key does not exist.- Parameters:
source
- must not be null.- Returns:
- See Also:
-
append
Append a value to key.- Parameters:
key
- must not be null.value
- must not be null.- Returns:
- See Also:
-
append
reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveStringCommands.AppendCommand,Long>> append(org.reactivestreams.Publisher<ReactiveStringCommands.AppendCommand> commands) Append aReactiveStringCommands.AppendCommand.getValue()
to theReactiveRedisConnection.KeyCommand.getKey()
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
getRange
Get a substring of value of key between start and end.- Parameters:
key
- must not be null.start
-end
-- Returns:
- See Also:
-
getRange
reactor.core.publisher.Flux<ReactiveRedisConnection.ByteBufferResponse<ReactiveRedisConnection.RangeCommand>> getRange(org.reactivestreams.Publisher<ReactiveRedisConnection.RangeCommand> commands) Get a substring of value of key between start and end.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
setRange
Overwrite parts of key starting at the specified offset with given value.- Parameters:
key
- must not be null.value
- must not be null.offset
-- Returns:
- See Also:
-
setRange
reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveStringCommands.SetRangeCommand,Long>> setRange(org.reactivestreams.Publisher<ReactiveStringCommands.SetRangeCommand> commands) Overwrite parts ofReactiveRedisConnection.KeyCommand.key
starting at the specified offset with givenReactiveStringCommands.SetRangeCommand.value
.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
getBit
Get the bit value at offset of value at key.- Parameters:
key
- must not be null.offset
-- Returns:
- See Also:
-
getBit
reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveStringCommands.GetBitCommand>> getBit(org.reactivestreams.Publisher<ReactiveStringCommands.GetBitCommand> commands) Get the bit value at offset of value at key.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
setBit
Sets the bit at offset in value stored at key and return the original value.- Parameters:
key
- must not be null.offset
-value
-- Returns:
-
setBit
reactor.core.publisher.Flux<ReactiveRedisConnection.BooleanResponse<ReactiveStringCommands.SetBitCommand>> setBit(org.reactivestreams.Publisher<ReactiveStringCommands.SetBitCommand> commands) Sets the bit at offset in value stored at key and return the original value.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
bitCount
Count the number of set bits (population counting) in value stored at key.- Parameters:
key
- must not be null.- Returns:
- See Also:
-
bitCount
Count the number of set bits (population counting) of value stored at key between start and end.- Parameters:
key
- must not be null.start
-end
-- Returns:
- See Also:
-
bitCount
reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveStringCommands.BitCountCommand,Long>> bitCount(org.reactivestreams.Publisher<ReactiveStringCommands.BitCountCommand> commands) Count the number of set bits (population counting) of value stored at key between start and end.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
bitField
default reactor.core.publisher.Mono<List<Long>> bitField(ByteBuffer key, BitFieldSubCommands subCommands) Get / Manipulate specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset stored at a givenkey
.- Parameters:
key
- must not be null.subCommands
-- Returns:
- Since:
- 2.1
- See Also:
-
bitField
reactor.core.publisher.Flux<ReactiveRedisConnection.MultiValueResponse<ReactiveStringCommands.BitFieldCommand,Long>> bitField(org.reactivestreams.Publisher<ReactiveStringCommands.BitFieldCommand> commands) Get / Manipulate specific integer fields of varying bit widths and arbitrary non (necessary) aligned offset stored at a givenkey
.- Parameters:
commands
- must not be null.- Returns:
- Since:
- 2.1
- See Also:
-
bitOp
default reactor.core.publisher.Mono<Long> bitOp(Collection<ByteBuffer> keys, RedisStringCommands.BitOperation bitOp, ByteBuffer destination) Perform bitwise operations between strings.- Parameters:
keys
- must not be null.bitOp
- must not be null.destination
- must not be null.- Returns:
- See Also:
-
bitOp
reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveStringCommands.BitOpCommand,Long>> bitOp(org.reactivestreams.Publisher<ReactiveStringCommands.BitOpCommand> commands) Perform bitwise operations between strings.- Parameters:
commands
- must not be null.- Returns:
- See Also:
-
bitPos
Return the position of the first bit set to givenbit
in a string.- Parameters:
key
- the key holding the actual String.bit
- the bit value to look for.- Returns:
Mono
emitting result when ready.- Since:
- 2.1
-
bitPos
default reactor.core.publisher.Mono<Long> bitPos(ByteBuffer key, boolean bit, org.springframework.data.domain.Range<Long> range) Return the position of the first bit set to givenbit
in a string.Range
start and end can contain negative values in order to index bytes starting from the end of the string, where -1 is the last byte, -2 is the penultimate.- Parameters:
key
- the key holding the actual String.bit
- the bit value to look for.range
- must not be null. UseRange.unbounded()
to not limit search.- Returns:
Mono
emitting result when ready.- Since:
- 2.1
-
bitPos
reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveStringCommands.BitPosCommand,Long>> bitPos(org.reactivestreams.Publisher<ReactiveStringCommands.BitPosCommand> commands) Emmit the the position of the first bit set to givenbit
in a string. Get the length of the value stored at key.- Parameters:
commands
- must not be null.- Returns:
Flux
emitting results when ready.- Since:
- 2.1
-
strLen
Get the length of the value stored at key.- Parameters:
key
- must not be null.- Returns:
- See Also:
-
strLen
reactor.core.publisher.Flux<ReactiveRedisConnection.NumericResponse<ReactiveRedisConnection.KeyCommand,Long>> strLen(org.reactivestreams.Publisher<ReactiveRedisConnection.KeyCommand> keys) Get the length of the value stored at key.- Parameters:
keys
- must not be null.- Returns:
- See Also:
-