Package io.lettuce.core.api.reactive
Interface RedisSetReactiveCommands<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 RedisSetReactiveCommands<K,V>
Reactive executed commands for Sets.- 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>
sadd(K key, V... members)
Add one or more members to a set.Mono<Long>
scard(K key)
Get the number of members in a set.Mono<Long>
sdiff(ValueStreamingChannel<V> channel, K... keys)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysdiff(K...)
.Flux<V>
sdiff(K... keys)
Subtract multiple sets.Mono<Long>
sdiffstore(K destination, K... keys)
Subtract multiple sets and store the resulting set in a key.Mono<Long>
sinter(ValueStreamingChannel<V> channel, K... keys)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysinter(K...)
.Flux<V>
sinter(K... keys)
Intersect multiple sets.Mono<Long>
sintercard(long limit, K... keys)
This command works exactly likesinter(java.lang.Object[])
but instead of returning the result set, it returns just the cardinality of the result.Mono<Long>
sintercard(K... keys)
This command works exactly likesinter(java.lang.Object[])
but instead of returning the result set, it returns just the cardinality of the result.Mono<Long>
sinterstore(K destination, K... keys)
Intersect multiple sets and store the resulting set in a key.Mono<Boolean>
sismember(K key, V member)
Determine if a given value is a member of a set.Mono<Long>
smembers(ValueStreamingChannel<V> channel, K key)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysmembers(K)
.Flux<V>
smembers(K key)
Get all the members in a set.Flux<Boolean>
smismember(K key, V... members)
Returns whether each member is a member of the set stored at key.Mono<Boolean>
smove(K source, K destination, V member)
Move a member from one set to another.Mono<V>
spop(K key)
Remove and return a random member from a set.Flux<V>
spop(K key, long count)
Remove and return one or multiple random members from a set.Mono<Long>
srandmember(ValueStreamingChannel<V> channel, K key, long count)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysrandmember(K)
.Mono<V>
srandmember(K key)
Get one random member from a set.Flux<V>
srandmember(K key, long count)
Get one or multiple random members from a set.Mono<Long>
srem(K key, V... members)
Remove one or more members from a set.Mono<StreamScanCursor>
sscan(ValueStreamingChannel<V> channel, K key)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysscan(K)
.Mono<StreamScanCursor>
sscan(ValueStreamingChannel<V> channel, K key, ScanArgs scanArgs)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysscan(K)
.Mono<StreamScanCursor>
sscan(ValueStreamingChannel<V> channel, K key, ScanCursor scanCursor)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysscan(K)
.Mono<StreamScanCursor>
sscan(ValueStreamingChannel<V> channel, K key, ScanCursor scanCursor, ScanArgs scanArgs)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysscan(K)
.Mono<ValueScanCursor<V>>
sscan(K key)
Incrementally iterate Set elements.Mono<ValueScanCursor<V>>
sscan(K key, ScanArgs scanArgs)
Incrementally iterate Set elements.Mono<ValueScanCursor<V>>
sscan(K key, ScanCursor scanCursor)
Incrementally iterate Set elements.Mono<ValueScanCursor<V>>
sscan(K key, ScanCursor scanCursor, ScanArgs scanArgs)
Incrementally iterate Set elements.Mono<Long>
sunion(ValueStreamingChannel<V> channel, K... keys)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysunion(K...)
.Flux<V>
sunion(K... keys)
Add multiple sets.Mono<Long>
sunionstore(K destination, K... keys)
Add multiple sets and store the resulting set in a key.
-
-
-
Method Detail
-
sadd
Mono<Long> sadd(K key, V... members)
Add one or more members to a set.- Parameters:
key
- the key.members
- the member type: value.- Returns:
- Long integer-reply the number of elements that were added to the set, not including all the elements already present into the set.
-
scard
Mono<Long> scard(K key)
Get the number of members in a set.- Parameters:
key
- the key.- Returns:
- Long integer-reply the cardinality (number of elements) of the set, or
false
ifkey
does not exist.
-
sdiff
Flux<V> sdiff(K... keys)
Subtract multiple sets.- Parameters:
keys
- the key.- Returns:
- V array-reply list with members of the resulting set.
-
sdiff
@Deprecated Mono<Long> sdiff(ValueStreamingChannel<V> channel, K... keys)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysdiff(K...)
.Subtract multiple sets.- Parameters:
channel
- the channel.keys
- the keys.- Returns:
- Long count of members of the resulting set.
-
sdiffstore
Mono<Long> sdiffstore(K destination, K... keys)
Subtract multiple sets and store the resulting set in a key.- Parameters:
destination
- the destination type: key.keys
- the key.- Returns:
- Long integer-reply the number of elements in the resulting set.
-
sinter
Flux<V> sinter(K... keys)
Intersect multiple sets.- Parameters:
keys
- the key.- Returns:
- V array-reply list with members of the resulting set.
-
sinter
@Deprecated Mono<Long> sinter(ValueStreamingChannel<V> channel, K... keys)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysinter(K...)
.Intersect multiple sets.- Parameters:
channel
- the channel.keys
- the keys.- Returns:
- Long count of members of the resulting set.
-
sintercard
Mono<Long> sintercard(K... keys)
This command works exactly likesinter(java.lang.Object[])
but instead of returning the result set, it returns just the cardinality of the result.- Parameters:
keys
- the keys.- Returns:
- The cardinality of the set which would result from the intersection of all the given sets.
- Since:
- 6.2
-
sintercard
Mono<Long> sintercard(long limit, K... keys)
This command works exactly likesinter(java.lang.Object[])
but instead of returning the result set, it returns just the cardinality of the result.- Parameters:
limit
- If the intersection cardinality reaches limit partway through the computation, the algorithm will exit and yield limit as the cardinality.keys
- the keys.- Returns:
- The cardinality of the set which would result from the intersection of all the given sets.
- Since:
- 6.2
-
sinterstore
Mono<Long> sinterstore(K destination, K... keys)
Intersect multiple sets and store the resulting set in a key.- Parameters:
destination
- the destination type: key.keys
- the key.- Returns:
- Long integer-reply the number of elements in the resulting set.
-
sismember
Mono<Boolean> sismember(K key, V member)
Determine if a given value is a member of a set.- Parameters:
key
- the key.member
- the member type: value.- Returns:
- Boolean integer-reply specifically:
true
if the element is a member of the set.false
if the element is not a member of the set, or ifkey
does not exist.
-
smembers
Flux<V> smembers(K key)
Get all the members in a set.- Parameters:
key
- the key.- Returns:
- V array-reply all elements of the set.
-
smembers
@Deprecated Mono<Long> smembers(ValueStreamingChannel<V> channel, K key)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysmembers(K)
.Get all the members in a set.- Parameters:
channel
- the channel.key
- the keys.- Returns:
- Long count of members of the resulting set.
-
smismember
Flux<Boolean> smismember(K key, V... members)
Returns whether each member is a member of the set stored at key.- Parameters:
key
- the key.members
- the member type: value.- Returns:
- Boolean array-reply list representing the membership of the given elements, in the same order as they are requested.
- Since:
- 6.1
-
smove
Mono<Boolean> smove(K source, K destination, V member)
Move a member from one set to another.- Parameters:
source
- the source key.destination
- the destination type: key.member
- the member type: value.- Returns:
- Boolean integer-reply specifically:
true
if the element is moved.false
if the element is not a member ofsource
and no operation was performed.
-
spop
Mono<V> spop(K key)
Remove and return a random member from a set.- Parameters:
key
- the key.- Returns:
- V bulk-string-reply the removed element, or
null
whenkey
does not exist.
-
spop
Flux<V> spop(K key, long count)
Remove and return one or multiple random members from a set.- Parameters:
key
- the key.count
- number of members to pop.- Returns:
- V bulk-string-reply the removed element, or
null
whenkey
does not exist.
-
srandmember
Mono<V> srandmember(K key)
Get one random member from a set.- Parameters:
key
- the key.- Returns:
- V bulk-string-reply without the additional
count
argument the command returns a Bulk Reply with the randomly selected element, ornull
whenkey
does not exist.
-
srandmember
Flux<V> srandmember(K key, long count)
Get one or multiple random members from a set.- Parameters:
key
- the key.count
- the count type: long.- Returns:
- V bulk-string-reply without the additional
count
argument the command returns a Bulk Reply with the randomly selected element, ornull
whenkey
does not exist.
-
srandmember
@Deprecated Mono<Long> srandmember(ValueStreamingChannel<V> channel, K key, long count)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysrandmember(K)
.Get one or multiple random members from a set.- Parameters:
channel
- streaming channel that receives a call for every value.key
- the key.count
- the count.- Returns:
- Long count of members of the resulting set.
-
srem
Mono<Long> srem(K key, V... members)
Remove one or more members from a set.- Parameters:
key
- the key.members
- the member type: value.- Returns:
- Long integer-reply the number of members that were removed from the set, not including non existing members.
-
sunion
Flux<V> sunion(K... keys)
Add multiple sets.- Parameters:
keys
- the key.- Returns:
- V array-reply list with members of the resulting set.
-
sunion
@Deprecated Mono<Long> sunion(ValueStreamingChannel<V> channel, K... keys)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysunion(K...)
.Add multiple sets.- Parameters:
channel
- streaming channel that receives a call for every value.keys
- the keys.- Returns:
- Long count of members of the resulting set.
-
sunionstore
Mono<Long> sunionstore(K destination, K... keys)
Add multiple sets and store the resulting set in a key.- Parameters:
destination
- the destination type: key.keys
- the key.- Returns:
- Long integer-reply the number of elements in the resulting set.
-
sscan
Mono<ValueScanCursor<V>> sscan(K key)
Incrementally iterate Set elements.- Parameters:
key
- the key.- Returns:
- ValueScanCursor<V> scan cursor.
-
sscan
Mono<ValueScanCursor<V>> sscan(K key, ScanArgs scanArgs)
Incrementally iterate Set elements.- Parameters:
key
- the key.scanArgs
- scan arguments.- Returns:
- ValueScanCursor<V> scan cursor.
-
sscan
Mono<ValueScanCursor<V>> sscan(K key, ScanCursor scanCursor, ScanArgs scanArgs)
Incrementally iterate Set elements.- Parameters:
key
- the key.scanCursor
- cursor to resume from a previous scan, must not benull
.scanArgs
- scan arguments.- Returns:
- ValueScanCursor<V> scan cursor.
-
sscan
Mono<ValueScanCursor<V>> sscan(K key, ScanCursor scanCursor)
Incrementally iterate Set elements.- Parameters:
key
- the key.scanCursor
- cursor to resume from a previous scan, must not benull
.- Returns:
- ValueScanCursor<V> scan cursor.
-
sscan
@Deprecated Mono<StreamScanCursor> sscan(ValueStreamingChannel<V> channel, K key)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysscan(K)
.Incrementally iterate Set elements.- Parameters:
channel
- streaming channel that receives a call for every value.key
- the key.- Returns:
- StreamScanCursor scan cursor.
-
sscan
@Deprecated Mono<StreamScanCursor> sscan(ValueStreamingChannel<V> channel, K key, ScanArgs scanArgs)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysscan(K)
.Incrementally iterate Set elements.- Parameters:
channel
- streaming channel that receives a call for every value.key
- the key.scanArgs
- scan arguments.- Returns:
- StreamScanCursor scan cursor.
-
sscan
@Deprecated Mono<StreamScanCursor> sscan(ValueStreamingChannel<V> channel, K key, ScanCursor scanCursor, ScanArgs scanArgs)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysscan(K)
.Incrementally iterate Set elements.- Parameters:
channel
- streaming channel that receives a call for every value.key
- the key.scanCursor
- cursor to resume from a previous scan, must not benull
.scanArgs
- scan arguments.- Returns:
- StreamScanCursor scan cursor.
-
sscan
@Deprecated Mono<StreamScanCursor> sscan(ValueStreamingChannel<V> channel, K key, ScanCursor scanCursor)
Deprecated.since 6.0 in favor of consuming large results through thePublisher
returned bysscan(K)
.Incrementally iterate Set elements.- Parameters:
channel
- streaming channel that receives a call for every value.key
- the key.scanCursor
- cursor to resume from a previous scan, must not benull
.- Returns:
- StreamScanCursor scan cursor.
-
-